Repository navigation
Conversation
Contributor
|
Install the packages built from this commit: alchemypnpm install https://pkg.alchemy.run/alchemy/pr:2567:ff18dc6@alchemy.run (16)pnpm install https://pkg.alchemy.run/@alchemy.run/better-auth/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/git/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/drizzle/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/acme/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/planetscale/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/neon/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/aws/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/domain/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/kubernetes/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/docker/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/sql/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/cloudflare-runtime/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/frontend-frameworks/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/node-utils/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@alchemy.run/pkg/pr:2567:ff18dc6Transitive Dependencies (9)pnpm install https://pkg.alchemy.run/@distilled.cloud/aws/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@distilled.cloud/acme/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@distilled.cloud/core/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@distilled.cloud/planetscale/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@distilled.cloud/neon/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@distilled.cloud/aws4signer/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@distilled.cloud/cloudflare/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@distilled.cloud/iceberg/pr:2567:ff18dc6pnpm install https://pkg.alchemy.run/@distilled.cloud/github/pr:2567:ff18dc6Published |
This was referenced Oct 25, 2026
Open
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.
A page that shows a view at first paint and then follows it live has no read that gives the state and the place to resume from together.
getgives the state without a cursor.list(key, { order: "desc", take: 1 })gives the last entry's state andseq, butlisthas noatLeast: right after a write, it can read before the view folded it, so the page starts from an old cursor and replays entries it already shows.Found while building a Foldkit front on Domain in a production app: the server renders the board into the page, and the browser's feed must start where that board ends, with no spinner, no gap and no duplicate.
What changed
ViewClient.snapshot(key, { atLeast?, where? })gives{ state, cursor }. Both come from one stored view snapshot (ViewSnapshot.stateand.seq), so the cursor always matches the state.cursoris a string, aseventstakes it inafter;"0"for a key with no events.validatejudgessnapshotlikeget(mode"get"), andwherenarrows the state likeget.ViewClient.listtakesatLeast, asgetdoes.View.Host.snapshot(the hosted view inside a model) and theView.Snapshot<S>type. The view host'squeryandsnapshotshare oneatLeastwait.<View>.snapshotRPC in the view's read RPCs, so it works overprotocolHttpandprotocolWebSocket(a plain call).building-blocks.mdandfrontend.md.Tests. New
test/Domain/ViewSnapshot.test.ts, 4 tests: a snapshot of an empty key is{ state: null, cursor: "0" }, and the cursor equals the last entry'sseq; two writes between the snapshot andevents({ after: cursor })arrive once each (seq 2 and 3), and snapshot plus feed equalsget; the same over a real HTTP server withprotocolHttp;listwithatLeastsees a write made just before it (the test fails withoutatLeast).pnpm test:integration test/Domain: 69 passed, 0 failed (65 before).format:check,tsrs -b,lint,docs:check-jsdoc,exports:checkanddocs:checkpass locally.Limits. Views only; streams keep
peek(it hasatLeast) andlist(noatLeast). One key per call: a board plus one card per row is still N+1 reads.