Local-first stream: IndexedDB store, delta sync API, worker decode, and virtualized mobile list#390
Open
Local-first stream: IndexedDB store, delta sync API, worker decode, and virtualized mobile list#390
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7235df2238
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…-for-updatedat Stabilize dev stream seals and accept /p~ payload links
…rror Add stream endpoints to dev API to resolve /api/stream/head 404s
…-returning-seal Fix stream delta catch-up pagination, persisted baseline, and URL ingest churn
…visibility-change Optimize StreamList ingestion to avoid repeated full URL processing
…oints-for-performance Optimize stream sync with persisted index + cursor pagination
…ate-process Fix stream resync when source digest changes
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.
Motivation
Description
streamStore.getFeedPage(cursor, limit),streamStore.getThread(token, depth),streamStore.applyDelta(delta),streamStore.getPreview(urlOrToken), andstreamStore.prefetchAround(token)(new files:/workspace/PHI_NETWORK/src/lib/stream/streamStore.ts,/workspace/PHI_NETWORK/src/workers/streamWorker.ts).GET /api/stream/head,GET /api/stream/delta?after=<seal>&limit=<n>, andGET /api/stream/snapshot?compact=1, plus server helpers to compute row previews and a deterministic seal (new files:/workspace/PHI_NETWORK/api/stream/data.ts,/workspace/PHI_NETWORK/api/stream/head.ts,/workspace/PHI_NETWORK/api/stream/delta.ts,/workspace/PHI_NETWORK/api/stream/snapshot.ts)./workspace/PHI_NETWORK/src/lib/stream/streamStore.ts,/workspace/PHI_NETWORK/src/workers/streamWorker.ts)./workspace/PHI_NETWORK/src/pages/sigilstream/list/StreamList.tsx,/workspace/PHI_NETWORK/src/pages/sigilstream/list/virtualWindow.ts)./workspace/PHI_NETWORK/src/pages/sigilstream/SigilStreamRoot.tsx, and added sync helper/workspace/PHI_NETWORK/src/lib/stream/streamSync.ts)./workspace/PHI_NETWORK/tests/stream_upgrade.test.mjs).Testing
npm test -- tests/stream_upgrade.test.mjs— all tests in that file passed (delta apply correctness, offline-first snapshot path, worker-fallback flag, virtualization bounds) ✅.npm run buildexecuted successfully (TypeScript compile + Vite build) ✅.http://127.0.0.1:4173/streamand produced a mobile screenshot atbrowser:/tmp/codex_browser_invocations/.../artifacts/artifacts/stream-mobile-upgrade.png(visual smoke check) ✅.Files changed (absolute paths)
Commands run (selection) and outcomes
npm test -- tests/stream_upgrade.test.mjs— passed (targeted tests) ✅npm run build— succeeded (TypeScript + Vite build) ✅npm test— full test run started and many subtests passed during validation; targeted verification used for this PR (no regressions observed in the exercised areas)Remaining risks & recommended next steps
public/links.jsonscan; for large production feeds convert this to a persisted append-only index or change journal to make delta computation O(delta) rather than scanning.delta/snapshotfor robust server-side pagination when dataset grows.If you want, I can split the server endpoints into a separate service, add an HTTP integration test that runs a dev API and validates full delta synchronization, or add a small opt-in feature flag for aggressive prefetch tuning on high-end devices.
Codex Task