Skip to content

Telemetry: count each sync backend once per app load - #69

Merged
jonocodes merged 1 commit into
mainfrom
goatcounter/backend-detection
Sep 19, 2026
Merged

jonocodes merged 1 commit into
mainfrom
goatcounter/backend-detection

Conversation

@jonocodes

Copy link
Copy Markdown
Owner

Why

sync-connect-<backend> events (Dropbox / Google Drive / remoteStorage) over-counted: RemoteStorage re-emits connected for an already-connected backend on every app load — Dropbox emits it twice — so each page load by a connected user logged multiple events.

What

  • Track providers already reported for the current page load and fire sync-connect-* once per provider. A different provider connecting later in the session still counts.
  • Add the missing sync-connect-remotestorage row to the documented event table (previously only Dropbox and Google Drive were listed).

Verification

  • Local end-to-end probe (dev app + local Armadietto + simulated connected Dropbox state): connected fired twice, produced a single sync-connect-dropbox beacon after the fix (2 before).
  • npx tsc --noEmit and eslint src/utils/sync/storage.ts clean.

RemoteStorage re-emits "connected" for an already-connected backend during
startup (Dropbox emits it twice), so sync-connect events over-counted app
loads by connected users. Track providers already reported for the page load
and fire once per provider, so the events read as "app loads using <backend>" —
a different provider connecting later in the session still counts.

Also list sync-connect-remotestorage in the documented event table, which
previously only covered Dropbox and Google Drive.
@jonocodes
jonocodes merged commit 330250a into main Sep 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant