Skip to content

Plucks waiting on a device follow one set of rules - #117

Merged
NiallJoeMaher merged 1 commit into
mainfrom
arch-device-queue
Oct 27, 2026
Merged

NiallJoeMaher merged 1 commit into
mainfrom
arch-device-queue

Conversation

@NiallJoeMaher

Copy link
Copy Markdown
Contributor

The keep and drop rules for plucks waiting on a device now live in one place, createDrain in packages/client/src/queue.ts. A pluck that is sent or refused leaves the queue. Anything else (offline, signed out, a 429 or 5xx) keeps it and stops the drain. Only one drain runs at a time.

  • Web: TopBar.tsx drops its own loop and uses createQueue over localStorage, with the Web Lock kept. The status mapping is the client's new answer(res), which createClient now uses too. Entries already queued in the old { draft, body } shape are read using the draft's key as their id. onPlucked now takes the draft key, which is all ItemList used.
  • iPhone shares: the App Group files go through createDrain with a store that can only read and remove: the share extension writes the files and the app only takes them away, so rewriting the whole list would race with it. The Swift file format is unchanged. Shares are still kept when signed out, on a 5xx or offline, and dropped only on a refusal or when unreadable. The body still carries clientKey: <file name>.
  • Extension and iPhone queue: unchanged; they use createQueue as before.
  • Tests: client.test.ts now covers keep-on-signed-out, keep-on-offline/down and keep-on-unexpected, with the same clientKey on every resend. The existing tests cover drop-on-refused, order, no double send and plucks queued mid-drain.
  • Docs: architecture.md drops candidate 4 and updates the packages/client row.

Not run: pnpm e2e and pnpm design (the lead runs them). The iPhone paths have not been run on a device.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Per4f8yL5A7nL9frZVDJj7

…nsion, the iPhone app and its shares all drain through createQueue's

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Per4f8yL5A7nL9frZVDJj7
Signed-off-by: NiallJoeMaher <nialljoemaher@gmail.com>
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pluck Ready Ready Preview Oct 27, 2026 7:21am UTC

Request Review

@NiallJoeMaher
NiallJoeMaher merged commit c58cef7 into main Oct 27, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant