fix(editor): stop earning post points for editing a post - #3499
Conversation
A comment op is identical on chain whether it publishes content or edits it, so the SDK cannot tell them apart on its own and was recording a type-100 POST activity for every post edit. makeJsonMetadataForUpdate deliberately keeps the original app tag, so editing a post first published on another frontend was credited here as a post published here, paying post points and ticking the daily quest. @ecency/sdk 2.3.86 adds isUpdate to the comment payload, which _submitEdit now sets on the non-reply branch. Reply edits go through useUpdateReply, which stopped recording activity in the same release, so they need no change here beyond the bump. The payload is annotated as CommentPayload rather than passed inline because commentMutation arrives through untyped props: an inline literal is checked against nothing, so a misspelt isUpdate would typecheck clean and silently resume paying for edits. Verified both ways, the typo now fails with TS2561. Closes #3498
PR Summary by QodoFix editor post edits from earning post points by flagging SDK comment updates
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
PR Summary by QodoFix editor: prevent post points/quest credit when editing an existing post
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe editor now submits non-reply post edits with a typed ChangesPost edit activity
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change stops post edits from requesting post-earning activity while preserving rewards for newly created content; no actionable merge-blocking risk remains after normal checks and review. Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
Closes #3498
What
A
commentop is identical on chain whether it publishes content or edits it, so the SDK cannot tell them apart on its own and was recording a type-100 POST activity for every post edit.makeJsonMetadataForUpdatedeliberately keeps the originalapptag, which is correct provenance behaviour, so editing a post first published on another frontend was credited here as a post published here: post points plus the daily quest tick.@ecency/sdk2.3.86 addsisUpdateto the comment payload._submitEditnow sets it on the non-reply branch.Reply edits go through
useUpdateReply, which stopped recording activity entirely in the same release, so they need no change here beyond the bump. That also coverspostOptionsModal, which uses the same mutation.Checked the other call sites:
usePostSubmitteralways sets aparentAuthorand only ever creates new content, so it keeps recording, correctly.The typed payload is load-bearing
commentMutationarrives through untyped props on a class component, so an inline object literal is checked against nothing. I verified this: a deliberateisUpdatex: truepassedyarn typecheckclean with 0 errors.Annotating the payload as
CommentPayloadrestores the check. The same typo now fails:Without that, a future rename or typo would silently resume paying for edits, with nothing failing.
Verification
yarn install --frozen-lockfileexits 0, so the lockfile edit is consistent. Deps and peerDeps are byte-identical between 2.3.85 and 2.3.86, only the tarball and integrity changed.@ecency/sdkis 2.3.86 and carries the compiled gate:function hp(e){return e.isUpdate?null:e.parentAuthor?110:100}.yarn typecheck: 0 errors, baseline 0. Typo variant fails as above.yarn test:ci: 870 passed, 1 skipped.development.Context
Third and last piece of the fix for edits earning content rewards, reported by a community member who spotted an account holding the leaderboard quest badge while publishing from another frontend.
This one stops the pointless request being made at all. It is hygiene rather than the gate, since the backend already refuses.
Summary by CodeRabbit