OverviewFilesCommitsIssuesDocsReleasesPeers

favela-android commits / a4a4cbd

drop the optimistic index writes that no screen reads any more
compose and deletePost wrote into the worklet's own appview so the UI would update before the firehose round-trip. Every screen now reads favela-web's index (f45bbec), so those writes updated something nobody reads — worse than dead, because a no-op that still runs looks like it works. Safe to remove because favela-web indexes the record itself: it holds hpp's overlay via ATPROTO_OVERLAY_ROOT and follows the DID's firehose. Observed directly on tabertron — a post appeared in /api/timeline immediately after the write and left it immediately on delete. ⚠ NOT removed: putFollow/delFollow. They look like the same dead pattern and are not — `follow` reads state.appview.followRkey(me, did) to decide which way the toggle goes, so those writes FEED that read. Removing them while keeping the read would let the toggle go stale and double-follow. The trio stays internally consistent until step 2 gives the read a favela-web replacement. This is the ready half of step 3. Deleting the Corestore/Appview/reindex loop outright is still blocked: viewDid, syncFollows and collections have no favela-web equivalent, and viewDid in particular is how a foreign DID becomes visible at all — there is no "track this DID" route, so deleting the appview would remove the phone's ability to see a community it does not host. Verified: 98 assertions green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
a4a4cbd830136f717ab317a3438fe1f7ec8d9b76
by plankatron <fleeky@gmail.com> · 2026-08-11T19:00:26.000Z

Changed files (1) +7 -2

lib/node.js +7 -2
……@@ -475,14 +475,19 @@ const handlers = {
475475 const langs = /^[a-z]{2}(-[A-Za-z0-9]{2,8})?$/.test(String(lang || '')) ? [String(lang)] : ['en']
476476 const r = await w.post(String(text || ''), { scope, langs, reply: replyTo, quote: quoteOf })
477477 const uri = 'at://' + viewerDid() + '/' + r.collection + '/' + r.rkey
478 try { await state.appview.putPost({ did: viewerDid(), rkey: r.rkey, record: { $type: r.collection, text, createdAt: new Date().toISOString(), langs } }) } catch {}
478 // No optimistic index write. Every screen now reads favela-web's index, so writing into the
479 // worklet's own appview updated something nobody reads — a no-op that still looked like it worked.
480 // favela-web picks the record up itself: it holds hpp's overlay (ATPROTO_OVERLAY_ROOT) and follows
481 // the DID's firehose, and it indexes a local write promptly — observed on tabertron, where a post
482 // appeared in /api/timeline immediately after the write and left it immediately on delete.
479483 return { ...r, uri }
480484 },
481485 async deletePost ({ rkey, collection = 'app.bsky.feed.post' } = {}) {
482486 if (!rkey) throw new Error('deletePost requires { rkey }')
483487 const w = await writer()
484488 await w.putRecord(collection, rkey, null, { action: 'delete' })
485 try { await state.appview.delPost({ did: viewerDid(), rkey }) } catch {}
489 // Same as compose: the optimistic delete updated an index no screen reads. favela-web drops it
490 // from its own on the firehose round-trip.
486491 return { ok: true, rkey, collection }
487492 },
488493 // Follow is a TOGGLE and needs no strongRef — its subject is a plain DID, unlike a like or a repost