Fix crash on repeats of a blocked user's posts #3606
No reviewers
Labels
No labels
BE Request
Backlog
Better behavior
Blocked by deps
Bug
Code Review
Discussion
Doing
Feature Request / Enhancement
In the shining bright future maybe
It's complicated
MS Edge
Mememoon (or other niche browsers)
Missing API
Missing feature
Missing l10n/i18n
NL1
NL2
NL4
Need to verify on develop
RELEASE BLOCKER
Reassign or Close
Refactor
Regression
Safari
To Do
User story
Waiting on godot
accessibility
better documentation
chore
confirmed
easy ticket
incident
l10n update
mastoapi
mobile
needs design
needs-info
needs-review
stupid
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
pleroma/pleroma-fe!3606
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/missing-emoji-reactions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blocking a user wiped their statuses from the store, but other users' repeats of them stayed in the timelines. Such a repeat then rendered as a normal status, and
EmojiReactionsthrewthis.status.emoji_reactions is undefined(Pleroma sends noemoji_reactionson repeats).wipeUserStatusesalso wipes repeats of the wiped statuses.parseStatusdefaultsemoji_reactionsto[], for repeats whose post is missing for other reasons, and for backends withoutpleroma.Reproduced on develop against the mock backend (block a user whose post is repeated in Home, switch timelines, scroll to the repeat); fixed on this branch.
Testing:
yarn unit-ci(526 passed),yarn ci-biome./oc review
opencode-agent:job=173:generation=1
Review verdict
No findings. This pull request is safe to merge.
What was checked
src/services/entity_normalizer/entity_normalizer.service.js):output.emoji_reactions = pleroma?.emoji_reactions ?? []is now assigned unconditionally, outside theif (data.pleroma)branch. This covers all three reported shapes:pleromablock at allreblog: nulland apleromablock lackingemoji_reactionspleroma.emoji_reactionsis present (passed through unchanged)src/components/emoji_reactions/emoji_reactions.js,src/stores/statuses.js, andsrc/components/status_action_buttons/action_button_container.jsall assume an array (.length,.slice,.find,.findIndex,.push); the[]default keeps every call site safe. Each call creates a fresh array, so there is no shared-mutable-default risk.parseStatus, so nested statuses inherit the same default.entity_normalizer.spec.js): new cases cover both the missing-pleromaand missing-emoji_reactionspaths plus the passthrough case.changelog.d/missing-emoji-reactions.fixfollows the repo one-line convention.Validation performed
biome checkon both changed source files: cleanMerge readiness
5/5 -- production-ready, no known findings.
Fix crash on statuses without emoji reactionsto Fix crash on repeats of a blocked user's posts/oc review
opencode-agent:job=174:generation=1
Review verdict
No findings. This pull request is safe to merge.
What was checked
src/services/entity_normalizer/entity_normalizer.service.js:289):output.emoji_reactions = pleroma?.emoji_reactions ?? []is now assigned unconditionally, outside theif (data.pleroma)branch. This covers all three reported shapes: Mastodon statuses with nopleromablock, Pleroma repeats rendered withreblog: nulland noemoji_reactions, and normal statuses where the field passes through unchanged. Each call allocates a fresh array, so there is no shared-mutable-default risk. Quote and retweet parsing recurse throughparseStatus, so nested statuses inherit the same default.src/components/emoji_reactions/emoji_reactions.jsandsrc/components/status_action_buttons/action_button_container.jscall array methods (.length,.find,.findIndex) onemoji_reactions; the[]default keeps every call site safe.src/stores/statuses.js:549-571):wipeUserStatusesnow also collects other users' repeats whoseretweeted_status.idis in the blocked user's set, deletes them fromallStatuses, removes each id from its author'sstatusesPerUserset, and returns the full removed set soblockUser(src/stores/users.js:576-578) also wipes them from timelines and notifications. The newrepeatscollection is a snapshot, so mutating the live per-user sets inside the loop is safe; every status processed comes fromallStatuses, whichaddNewStatusesalways registers instatusesPerUserandconversations, so the per-author and conversation deletions hit existing entries.entity_normalizer.spec.js(missing-pleroma, missing-emoji_reactions, passthrough) andstatuses.spec.js(wipeUserStatusesalso wipes repeats and cleans the repeater's per-user set) directly cover both changes.changelog.d/missing-emoji-reactions.fixfollows the one-line convention.Validation performed
biome checkon all four changed source/test files: cleanMerge readiness
5/5 -- production-ready, no known findings.