implement-offline-first-sync — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited implement-offline-first-sync (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
In local-first Blazor WebAssembly architectures, database mutations are committed to the browser's local sandbox SQLite database. When network connectivity is restored, these local operations must be synchronized back to the primary server without silently overwriting concurrent changes made by other users.
This skill provides a programmatic playbook for building an offline sync queue, managing optimistic concurrency tokens, and resolving data synchronization conflicts in client-side .NET applications.
Before executing this workflow, the agent needs:
uint ConcurrencyToken or long LastModifiedTicks).To record database mutations while offline, maintain a dedicated sync queue table inside the SQLite schema:
SyncItem entity to record changes: public class SyncItem
{
public int Id { get; set; }
public string EntityName { get; set; } = string.Empty;
public string EntityId { get; set; } = string.Empty;
public string Action { get; set; } = string.Empty; // INSERT, UPDATE, DELETE
public string Payload { get; set; } = string.Empty; // JSON Serialized Entity DTO
public long CreatedAt { get; set; }
}Checkpoint: Ensure `SyncItem` mutations are transactionally saved alongside primary model updates.
Prevent overwrite races by tracking entity state versions:
Checkpoint: Client-side writes will trigger an optimistic lock warning if the server's record has evolved.
When synchronization starts:
SyncQueue items ordered by CreatedAt.409 Conflict or DbUpdateConcurrencyException) and apply the conflict resolution policy:SyncQueue.Checkpoint: The local sync queue is fully drained and matches the server's primary database state.
To verify the synchronization engine is functioning correctly:
SyncQueue table collects matching transaction records.SyncQueue is completely emptied.| Pitfall | Why It Fails | Correct Approach |
|---|---|---|
Deleting SyncQueue items before synchronization succeeds | Network drops will cause permanent data loss. | Delete local sync entries only after receiving a successful synchronization response from the server. |
| Synchronizing out of order | Child entities (like EntryScore) will fail to insert if parent entities (like Entry) have not synced yet. | Always process the queue strictly in the chronological order (CreatedAt ascending) in which the changes occurred. |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.