Seen in the atomic-plugins money e2e traces analysed for #1846 (PR #1904). After a reload, the drive sync pushes updates (an app, its agent, its entry point) for resources whose page copy lacks the Loro history those updates were built on. Either they aren't loaded yet, or they were rebuilt from query results (hydrateResourceFromJson) without their oplog. Each logs incomplete Loro import … missing base state, fetching a full snapshot. The store then holds the resource as a still-loading placeholder while it repairs, which delays anything waiting on it (up to getResource's 10 s).
Proposed:
- In
Store.applyIncoming (or wherever sync updates are imported), if the resource has no local Loro base, fetch or import the snapshot first, or apply updates that carry a full snapshot directly, instead of attempting a delta import that must fail.
- Make query-hydrated resources record that they have no Loro base, so updates for them go straight to a snapshot.
A test: hydrate a resource from query JSON, deliver a delta update, and it ends up current without a failed import.
Seen in the atomic-plugins money e2e traces analysed for #1846 (PR #1904). After a reload, the drive sync pushes updates (an app, its agent, its entry point) for resources whose page copy lacks the Loro history those updates were built on. Either they aren't loaded yet, or they were rebuilt from query results (
hydrateResourceFromJson) without their oplog. Each logsincomplete Loro import … missing base state, fetching a full snapshot. The store then holds the resource as a still-loading placeholder while it repairs, which delays anything waiting on it (up togetResource's 10 s).Proposed:
Store.applyIncoming(or wherever sync updates are imported), if the resource has no local Loro base, fetch or import the snapshot first, or apply updates that carry a full snapshot directly, instead of attempting a delta import that must fail.A test: hydrate a resource from query JSON, deliver a delta update, and it ends up current without a failed import.