diff options
| author | Adam Soltys <[email protected]> | 2026-11-22 09:21:26 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-11-22 09:21:26 -0700 |
| commit | 21fa1db9ef8cdc2923a50a3adbe079a5169c7299 (patch) | |
| tree | af3d5f29b4808191bdd249a58bfb55c558aaae06 /src | |
| parent | cfa932611272a26a8f8d3ca64d2b473245335bc1 (diff) | |
| download | coinosv3-21fa1db9ef8cdc2923a50a3adbe079a5169c7299.tar.gz coinosv3-21fa1db9ef8cdc2923a50a3adbe079a5169c7299.zip | |
Your own boost shows in your feed. "I tried boosting this post but I don't see it in my feed" and "let me see it in the feed in chronological order so it shows up when I actually made the boost. I think we dedupe other boosts right? so maybe make an exception for our own" (Adam, 2026-11-22, boosting a post by pnk). The boost was published, but a feed shows a note once: the post was already in Following because he follows its author, so his kind 6 was folded away. A boost of your own is now the exception. It has a row of its own under "<name> reposted", placed by the time of the boost, whether or not the post is already in the feed, and it does not keep the post itself or someone else's repost of it out. The row goes in when Boost is tapped, in the open feed and Following when they carry your posts, as a new post of yours does. Other people's reposts are deduplicated as before. New own-boost-feed-test boosts a followed post that sits twelve rows down and checks the boost is first with the post still in its place, after the tap, after a reload and with no cache; feed-repost, feed-reboost and features-smoke pass.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VMan6Upic5L6MMJzkTn8zg
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/messages.js | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 57f0e23..03fabee 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -7771,22 +7771,28 @@ export function messagesFeature(ctx) { if (!staged) feedStaged.set(c, staged = new Set()); // (with those waiting a moment to go in together — admitQueues — or a // copy from a second relay, or another version of a clip, slips in) + const noteOf = (e) => (e.kind === REPOST ? repostInner(e) : e); + // Your own boost is the exception: it has a row of its own at the time + // you boosted, whether or not the post is in the feed already, and it + // doesn't keep the post itself (or someone else's repost of it) out. + const own = (e) => e.kind === REPOST && isMe(e.pubkey); const held = [...c.notes, ...(c.deferred || []), ...((admitQueues.get(c) || {}).evs || [])]; const known = new Set(held.map((e) => e.id)); for (const e of evs || []) noteForSpam(e); // A note shows once: as itself, or under the first repost of it to // arrive — counting the ones still warming at the door. // (`staged` holds the note's id too, for a repost) - const noteOf = (e) => (e.kind === REPOST ? repostInner(e) : e); - const notesIn = new Set(held.map((e) => noteOf(e)?.id).filter(Boolean)); + const notesIn = new Set(held.filter((e) => !own(e)).map((e) => noteOf(e)?.id).filter(Boolean)); + const boostedIn = new Set(held.filter(own).map((e) => noteOf(e)?.id).filter(Boolean)); // an addressable post (a 34235/34236 clip) once, however many versions of it come - for (const e of held) { const a = noteOf(e) && addrOf(noteOf(e)); if (a) notesIn.add(a); } - const addrNew = (e) => { const n = noteOf(e); const a = n && addrOf(n); return !a || (!notesIn.has(a) && !staged.has(a) && !!staged.add(a)); }; - const fresh = (e) => { const n = noteOf(e); return !!n && !notesIn.has(n.id) && !staged.has(n.id); }; - const unstage = (e) => { staged.delete(e.id); const n = noteOf(e); if (n) { staged.delete(n.id); const a = addrOf(n); if (a) staged.delete(a); } }; + for (const e of held) { const a = !own(e) && noteOf(e) && addrOf(noteOf(e)); if (a) notesIn.add(a); } + const addrNew = (e) => { const n = noteOf(e); const a = !own(e) && n && addrOf(n); return !a || (!notesIn.has(a) && !staged.has(a) && !!staged.add(a)); }; + const stageId = (e) => (own(e) ? 'own:' : '') + noteOf(e).id; + const fresh = (e) => { const n = noteOf(e); return !!n && !(own(e) ? boostedIn : notesIn).has(n.id) && !staged.has(stageId(e)); }; + const unstage = (e) => { staged.delete(e.id); const n = noteOf(e); if (n) { staged.delete(stageId(e)); const a = !own(e) && addrOf(n); if (a) staged.delete(a); } }; const def = feedDef(c.id); let add = (evs || []).filter((e) => (e.kind === REPOST ? !(def && def.replies) && !!repostInner(e) && !hidden(repostInner(e)) && !reboosted(e) : feedKeeps(def, e)) && !hidden(e) - && fresh(e) && !known.has(e.id) && !staged.has(e.id) && addrNew(e) && known.add(e.id) && staged.add(e.id) && staged.add(noteOf(e).id)); + && fresh(e) && !known.has(e.id) && !staged.has(e.id) && addrNew(e) && known.add(e.id) && staged.add(e.id) && staged.add(stageId(e))); if (def && def.search) add = add.filter((e) => !nearCopy(c, held, e)); if (!add.length) return false; if (def && def.curated) { @@ -11823,6 +11829,9 @@ export function messagesFeature(ctx) { const evt = id.signer instanceof Uint8Array ? finalizeEvent(partial, id.signer) : await id.signer.signEvent(partial); noteEvent(evt); render(); + // in the feeds that carry your posts now, as your own post is + const carries = (def) => !!def && !def.replies && (!!def.all || feedAuthors(def).includes(id.pubkey)); + for (const c of new Set([feed, feedStates.get(FOLLOWING)])) if (c && !c.stopped && carries(feedDef(c.id))) mergeFeed([evt], {}, c).catch(() => {}); const ok = await publishOn(relays, evt); toast(ok ? t('postBoosted') : t('msgSendFailed')); } |
