Repository navigation
Keep a linked collection's new saves out of the Queue's inbox - #703
Merged
Merged
Conversation
A Semble/Margin collection linked or imported to the Shelf turned every article the reader hadn't saved into a new save in the Queue's inbox. The reconciler now archives the saves it creates (keyed on the new rkey, so an existing save keeps its Queue state), and the client pulls the label delta before reloading saves after a sync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014mh1a3RgSwf33Y5jeWaudB
…uid too A label stamped with the reconcile's start time could sit behind a client's label-delta cursor for good, and the Queue card checks a stub by its guid. Tests now clear item labels between cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014mh1a3RgSwf33Y5jeWaudB
disnet
marked this pull request as ready for review
October 27, 2026 05:17
refreshAfterSync now pulls the label delta before reloading saves; the test's itemLabels mock had no pullDelta, so every sync that brought saves in threw. Asserts the order too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014mh1a3RgSwf33Y5jeWaudB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Tim · project thread
What
When you linked or imported a Semble/Margin collection to the Shelf, every article you hadn't saved yet became a new save. New saves start in the Queue's inbox, so a 200-item collection put 200 items in the inbox.
Now the reconciler in
services/shelf-link.ts("added there") archives the saves it creates, usingarchiveNewSave. Each new save gets anarchivedlabel under its rkey, plus its guid when it has one. The guid is the key the Queue card and the sidebar count check for a stub. The label is written in the same batch withINSERT … SELECT … WHERE rkey = <new rkey>. If the save already existed, thesaved_articlesinsert does nothing and no label is written, so saves you made yourself keep their Queue state.This follows the Shelf plan's existing rule: archiving is how a save leaves the Queue while staying on the Shelf. Tim chose this over adding a new "Shelf-only" state. Imported items show the existing "Archived" chip on the Shelf.
Client: after a sync that brought in saves,
shelfStore.refreshAfterSyncpulls the label delta before it reloads saves, so the new items don't flash through the inbox.Docs:
saving-and-highlights.mdandSHELF_PLAN.mdare updated.Tests
shelf-link.spec.ts:reset()now clearsitem_labels_cache, so labels no longer leak between testsfrontend npm run checkis clean.Review (code-review skill at high effort, plus an independent adversarial agent)
Fixed
unixepoch()when the batch runs.isArchived(itemKey)) and the sidebar inbox count all missed stubs that have a guid. The label is now also written under the guid. Keeping the rkey copy means a tombstone already sitting on the guid can't push the save back into the inbox for alias-aware views.Left alone
runChunkedbatches, and if the second batch failed, the save would stay unarchived. This is rare, the cost is one inbox item, and fixing it means restructuring the batching.pullDelta()can reuse a pull that is already in flight and started before the sync committed. That shows a brief flash until the next pull. Background reconciles and other devices have the same race.archivedCountdoesn't count rkey-keyed labels. It has no callers outside the store.saved-import.ts'slabelInsert. A shared helper would touch an unrelated route.backing/sync.ts) still lands in the inbox. That is a separate feature.🤖 Generated with Claude Code
https://claude.ai/code/session_014mh1a3RgSwf33Y5jeWaudB