fix(mute): reposts of muted threads + false "reposted your note" label#21
Merged
Conversation
…label Two bugs surfaced by a kind-6 repost of a muted hellthread that copied the thread's whole p-tag list (so it tagged, and notified, a user who is neither the author nor a participant beyond being tagged): 1. Mute bypass. isInMutedThread() treated a repost as opaque: getThreadRootId only understands kind-1 threads, so for a kind-6/16 wrapper it returned the repost's own id and never checked the reposted note. A repost of a muted note/thread slipped into both feeds and notifications (and the unread counts that route through the same filter). Now isInMutedThread unwraps the reposted target (embedded JSON, else the e-tag id) and checks its id + root. 2. False attribution. RepostNotification hardcoded "reposted your note" for every repost that tagged you. Now it says "reposted your note" only when the reposted note's author is the viewer, else "reposted a note". Also adds a defense-in-depth isInMutedThread check on the async-fetched target in RepostNoteCard (covers a no-embedded-JSON repost of a reply in a muted thread). New en.ts key 'reposted a note'. Tests cover kind-6/16 reposts via embedded JSON and e-tag-only forms. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Deploying jank with
|
| Latest commit: |
5a719de
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6dc6670c.jank-4ii.pages.dev |
| Branch Preview URL: | https://fix-repost-mute-bypass-and-l.jank-4ii.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes two bugs that collided on one event: a kind-6 repost of a muted "hellthread" whose reposter copied the thread's entire 362-entry
p-tag list, so the repost tagged (and notified) a user who only ever appeared in that tag list.Reported symptom: a Notifications entry reading "DanWedge reposted your note" for a note the user neither authored nor wanted — one they had explicitly muted.
Bug 1 — reposts bypass thread-mute
isInMutedThread()treated a repost as opaque.getThreadRootIdonly understands kind-1 threads, so for a kind-6/16 wrapper it returned the repost's own id and never looked at the reposted note. A repost of a muted note/thread slipped into feeds, notifications, and the unread counts that route through the same filter.Now
isInMutedThreadunwraps the reposted target (embedded JSON incontent, else thee-tag id) and checks its id and computed root against the mute set. Quote-posts (kind 1) are unaffected — the existing "quotes aren't muted" behavior stays.Bug 2 — false "your note" attribution
RepostNotificationhardcodedt('reposted your note')for every repost that tagged you. Now it shows "reposted your note" only when the reposted note's author is the viewer, otherwise "reposted a note" (newen.tskey).Also
isInMutedThreadcheck on the async-fetched target inRepostNoteCard(covers a no-embedded-JSON repost of a reply inside a muted thread).Tests
event.spec.ts: kind-6 repost of muted root (embedded JSON), repost of a reply in the muted thread, e-tag-only (no content), kind-16 generic repost, and a repost of an unmuted note (stays visible).npm run buildgreen.Notes
en.tskept to a single added key (avoided the prettier-skew churn onmain).🤖 Generated with Claude Code