Skip to content

Store: sync updates for resources without local history trigger 'incomplete Loro import … fetching a full snapshot' #1905

Description

@michielbdejong

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    @tomic/lib@tomic/libbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions