Repository navigation
Data layer phase 1: Seam and link ids #424
Copy link
Copy link
Closed
5 / 55 of 5 issues completedMilestone
Description
Phase 1 of the data layer plan.
WebView sees: Faster Save and picker. Releasable because: the repository sits behind today's getDraft/saveDraft; the WebView still owns the edits. Needs: #407 (done).
Scope
Every read and write of interlinear data goes through the repository, and links get ids. The WebView doesn't change, apart from Save and the picker getting faster.
- Link ids.
TokenAnalysisLinkandSegmentAnalysisLinkgain anid, and the reducers and the PT9 converter (mergeLanguageAnalyses) write one on every new link. A saved interlinear project with any link that has no id loads as empty, as does each draft book holding one, with a log entry. There's no version bump and no migration. - Picks by rule. Where the reducers pick one record by list order, they pick by rule instead, so 3d to 3i port rules rather than order. The latest
updatedAt, then the smallest id, wins an approval tie, for words and segments alike. A merge folds the edited payload into the identical one with the earliestcreatedAt, then the smallest id. - Repository. An async interface plus an in-memory implementation over today's envelope and per-book shards.
getDraftandsaveDraftkeep their contracts but route through it, and an autosave still rewrites only the shards whose JSON changed, as on main. It keepsprojectStorage's guards, such as refusing to overwrite a record written by a newer build. It also runs in Node with file-backed storage, so the Data layer: capture a performance baseline before the database migration #407 harness can seed its tiers without PAPI once 1d and 4c break seeding over PAPI. - Conformance suite. It runs against the in-memory implementation, stays for good, and is the bar any later backend must pass.
- Save in the host. The pending autosave is the WebView's debounce timer, so before Save or Save As the WebView sends its pending
saveDraftand waits for it. The host then copies the draft into the interlinear project. The WebView sends only metadata. - Project summaries. The existing
InterlinearProjectSummary, stored on every project write instead of built per request, so the picker andgetPt9ImportForSourceread summaries for the requested source only.
Surface: no new WebView calls; Save takes metadata only.
Done when: Save and the picker send no analysis.
Performance checkpoint
| After | What to check | Baseline (large-loadable) |
|---|---|---|
| Phase 1 | Bytes per Save and per picker response | Save 74.9 MB; picker 83.9 MB |
Plan context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity