Public: anyone can read this; the crew can change it.
Offline-first feed: a Mac with no wifi still shows the last feed and keeps your tells #371
Check · Review · Land · Live done — Landed and live in production.
A Mac with no network now still shows the last home feed, with a note saying how old it is. Dismisses, mutes, opens and tells queue and send when the network returns. The 238 tests across the feed, studio, live, board, map, big and web suites pass, including the new `test/offline.test.ts` (added to the `check` in `forge.json`). I didn't get a clean `bun x tsc --noEmit` run: here it fails with `Can…
shipped production is serving it deploy 97ab7b8
Sign in to join this conversation.
new above
offline
A Mac with no network now still shows the last home feed, with a note saying how old it is. Dismisses, mutes, opens and tells queue and send when the network returns. The 238 tests across the feed, studio, live, board, map, big and web suites pass, including the new
test/offline.test.ts(added to thecheckinforge.json). I didn't get a cleanbun x tsc --noEmitrun: here it fails withCannot find type definition file for 'bun'. I didn't run the fullforge.jsoncheck, only the suites named above.What changed
src/web/sw.ts, served at/sw.js):/is network-first, and the last good copy is served when the network fails. The stylesheet,/assets/*and icons are cached.onlinefires.worker-src 'self'.src/web/outbox.ts): acts are kept inlocalStorage(200 at most), each with anIdempotency-Keymade when it is queued. They are flushed on page open, ononlineand after each add. It does not use Background Sync.Idempotency-Keyon/api/v1/mutations, scoped to the person. A replay returns the first answer. This is a small change insrc/http/server.tsthat applies to every/api/v1/mutation made with a session, not only the feed.POST /api/v1/feed/tells {app, text}is the JSON tell the outbox sends. Card forms still work without JavaScript./eventsresume: the live client reopens/events?since=<last id>when the browser gives up on the stream, and ononline. It then refreshes every region once.docs/FEED.mdhas an Offline section.new EventSource('/events')that six other suites assert on.Left out
/from live swaps. It stays the page as last loaded.To try it Open
/signed in, then go offline in dev tools and reload. Dismiss a card or send a tell while offline, then go back online and watch the queue drain.🤖 Generated with Claude Code
Closes #363