Open cached notebooks offline without waiting for Drive - #392
Merged
Merged
Conversation
Signed-off-by: Jeremy Lewi <jeremy@lewi.us>
Signed-off-by: Jeremy Lewi <jeremy@lewi.us>
jlewi
commented
Sep 24, 2026
jlewi
left a comment
Collaborator
Author
There was a problem hiding this comment.
Reviewed loading, asynchronous creation, worker RPC/version compatibility, journal lock boundaries, causal save adapters, first-download failures, and regression coverage.
Two findings were resolved in b72b076:
- P1 — mismatched editor/save snapshots:
.runmeopen and local refresh separately read the displayed snapshot and save baseline. Sync or another tab could append between those reads, causing a subsequent save to delete unseen content. Both now display the adapter's detachedinitialNotebook, returned with its captured history through the worker. The wire contract is versioned accordingly. - P2 — empty JSON creation still waited for Drive: the initial empty
docwas treated as a cache miss while upstream creation was pending. A locally created record with a pending parent identity now opens immediately, with JSON/IPYNB regressions.
Validation: required build/tests passed; all 1,757 app tests passed; 214 focused tests passed; real Chromium SharedWorker/OPFS concurrent-edit, blocked-sync, offline creation, and browser-restart checks passed. No unresolved review findings. Merge remains gated on CI for b72b076.
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.
Cached notebooks could remain on the loading screen until a Drive sync completed or the storage worker's five-minute RPC timeout expired. Newly created files in mounted Drive folders were already persisted locally with asynchronous upstream creation, but
load()immediately awaited that sync becauselastSyncedwas empty.Open cached
.runmeOPFS logs, cached JSON/IPYNB models, and newly created empty notebooks immediately; queue due reconciliation in the background. Pending Drive creation no longer blocks opening or editing. Only uncached notebooks await a download, and first-download errors propagate instead of appearing as successful empty notebooks.Open and local refresh render the snapshot captured by their operation-log save adapter. This prevents an upstream or other-tab append between two reads from becoming unseen content that the next save accidentally deletes. The returned snapshot is detached from the adapter's baseline. The worker
createViewresponse includes that snapshot, and its protocol version is bumped to 2. Mixed-version clients receive the existing reload error; close/reopen all tabs on the origin after deployment if an old worker remains alive. Browser storage need not be cleared.Fixes #250. Local content is immediately editable, including offline use.
Validation on
jlewi-runme-dev:runme run build testpassed.vitest run --testTimeout=15000).This removes upstream progress from local opening. Direct Drive-creation/Save As completion semantics, network deadlines, and diagnosis of the particular stalled production queue item are outside this change.