FOOTBALL ANALYTICS — PRIVATE PHONE INSTALLATION, OFFLINE EDITS & AUTO SYNC Phase 3: match draft synchronization (12 November 2026) DESKTOP IS THE ONLY AUTHORITATIVE MATCH DATABASE SERVER 1. Back up your existing application. Extract this updated ZIP to a SEPARATE test folder. 2. On Windows, start START_FOOTBALL_ANALYTICS.bat and keep it running. 3. Keep Tailscale signed in on the desktop and phone. Phone access uses your PRIVATE HTTPS Serve address, not Funnel. 4. From the phone, open the desktop's private HTTPS address in the same browser/PWA origin used previously. 5. Keep the app connected until the status shows "Connected · offline copy ready". 6. On mobile, install/open the PWA from its HTTPS address. Desktop can use localhost. 7. Turn off phone connectivity and test existing matches, Analytics, Plans and Strategies. 8. On Matches, create an offline Add draft or edit an existing match; the draft remains device-local and does not change server data yet. 9. Reconnect to the desktop with the app OPEN. Automatic synchronization starts when the authenticated desktop health check passes. 10. See "Pending Offline Match Drafts" on Matches. A matching server receipt is required before an accepted draft disappears. 11. After acceptance, use "Reload updated data" to update page tables and graphs from the newly confirmed server snapshot. 12. For a conflict, export the local draft backup; compare against the current server match. Apply the desired change manually and discard the conflict ONLY after review. RULES OF THE SYNC PROTOCOL - ADD, EDIT and DELETE match drafts synchronize while the app is open and the desktop is reachable. Logo changes remain online-only. - One operation ID is issued per draft; the server records idempotent receipts with committed changes. - A replay after network interruption cannot apply the same operation twice. - The server refuses duplicate IDs and edits based on stale revisions; conflicts are never silently overwritten. - The desktop uses SQLite as master and then syncs SOCCER_RATING.xlsx. A workbook sync warning does not mean the match was unsaved from SQLite. - Offline drafts and pending conflicts are not included in strategy calculations, P&L, or qualification. - The automatic check runs when the app is active, on reconnection, focus, and approximately every 30 seconds. - Background sync when the phone app is fully closed is NOT guaranteed, especially on iPhone/iPad. - If the desktop is off or Tailscale/private Serve is unavailable, drafts remain safely queued on that same phone/profile until it reconnects. - The strategy registry and research notes are browser-local; Phase 3 does NOT synchronize this browser state between phone and desktop. Only confirmed match records are synchronized. - Clearing browser storage, switching app origins, reinstalling the PWA, or changing profiles can remove unsent drafts. Export the JSON backup first. - Keep independent desktop backups; a phone cache alone is not a complete disaster-recovery backup. CHECK THE SYSTEM AFTER THE UPDATE - Confirm the desktop server identity via /api/health; it should advertise offlineSync:"v2". - Try an offline Add on phone, reconnect, ensure one new match appears on desktop, and verify the phone view refreshes automatically. - Try an offline Edit, change the same match on desktop before reconnect, and verify an explicit conflict is retained. - Test a lost connection during upload; retries must not duplicate matches. - Verify Excel workbook sync; if Excel is locked, use "Retry workbook sync" on Matches. This feature has been tested with isolated backend HTTP, SQLite, workbook and JS IndexedDB simulations. It still needs a full physical Windows + Tailscale + phone acceptance test. - Offline DELETE: tap the row trash icon while offline, approve the queue prompt, and confirm the row is marked DELETE PENDING. After reconnect, verify desktop deletion, zero pending drafts, and refreshed phone data. - Confirm that a stale-delete revision creates a CONFLICT and does not remove the newer desktop match.