General editorial guide prepared with AI assistance. Examples are hypothetical; implementation depends on project requirements and qualified review.
Decision and problem
A local copy is not a sufficient backup. Some records are read caches, some are unsent changes, and others are sensitive attachments. Distinguish them so storage cleanup does not remove unsynchronized work.
Designing the solution
Assign global record IDs, sync status and versions; retain deletion markers until affected devices can receive them under retention policy. Separate cache eviction from the outbox. On logout or permission revocation, apply a safe local-data and pending-change policy.
Practical acceptance test
Close the app during a save, reopen offline, reconnect and pull a deleted record. Verify no resurrection of deleted records and clear user-visible status for unconfirmed operations.
