From 9d73d5deb959712dd6007d639f278a8db9e6f2aa Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 22 Nov 2026 09:27:48 -0700 Subject: A boost carries the signed post, so it is not thrown away. "I refreshed my phone but still not seeing it in my following feed" (Adam, 2026-11-22, after 21fa1db made his own boosts show). His boost of pnk's post (kind 6 b412fa11) held a copy of the post with no signature: the row he tapped had been painted from the saved feed, which keeps posts without their signature, and the boost embedded that object as it was. A repost whose copy does not verify is left out by this app and by every client that checks, so the boost showed nowhere. Before boosting, a post that does not verify in memory is now fetched whole by id from the post's relays and the note relays, and only the signed fields go into the boost; when the signed post cannot be found the boost is not sent and the failure is said. own-boost-feed-test checks that both boosts it publishes carry a post that verifies; feed-repost passes. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01VMan6Upic5L6MMJzkTn8zg --- src/features/messages.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/features') diff --git a/src/features/messages.js b/src/features/messages.js index 03fabee..5ec55c7 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -11822,8 +11822,18 @@ export function messagesFeature(ctx) { if (iBoosted(ev.id)) { toast(t('postBoostedAlready')); return; } const id = await requireIdentity(); const relays = await noteRelaysFor(ev); + // The copy inside must carry its author's signature, or every client + // that checks it (this one too) throws the boost away. A post painted + // from the saved feed was stored without one: fetch it whole first. + let whole = ev.sig && verifyEvent({ ...ev }) ? ev : null; + if (!whole) { + const got = await queryOn([...new Set([...relays, ...NOTE_RELAYS])], { ids: [ev.id] }, 4000).catch(() => []); + whole = got.find((e) => e.id === ev.id && e.sig && verifyEvent(e)) || null; + } + if (!whole) { toast(t('msgSendFailed')); return; } + whole = { id: whole.id, pubkey: whole.pubkey, created_at: whole.created_at, kind: whole.kind, tags: whole.tags, content: whole.content, sig: whole.sig }; const partial = { - kind: 6, content: JSON.stringify(ev), created_at: Math.floor(Date.now() / 1000), + kind: 6, content: JSON.stringify(whole), created_at: Math.floor(Date.now() / 1000), tags: [['e', ev.id, relays[0] || '', 'mention'], ['p', ev.pubkey], CLIENT_TAG], }; const evt = id.signer instanceof Uint8Array ? finalizeEvent(partial, id.signer) : await id.signer.signEvent(partial); -- cgit v1.2.3