SyncResourceAdapter
Resource-specific glue for the generic loop in SyncEngine. Implement one of these (plus the wire DTO mapping) to make a new resource syncable — the contract logic (ack guard, pending guard, full-snapshot reconciliation, pagination drain, fullResyncRequired) lives in the engine, not here, so it holds identically for every resource.
Type Parameters
entity type (carries SyncableEntity bookkeeping)
Functions
Active (non-deleted) rows, for full-snapshot tombstone reconciliation.
Drop clean synced rows for fullResyncRequired.
Writes a batch of rows produced from one ack set, one page of server changes, or one tombstone sweep. The default calls upsert per row; override it to write the batch in a single database transaction. The engine reads rows before calling this method, so a transaction around these writes alone does not make its guards atomic with concurrent local edits. Adapters must also enforce conditional writes against the current local version when local editing can race sync persistence.