Skip to content

Sync the buffer to the server #13

Closed

Description

@mikahatdichlieb

Upload buffered events with POST /api/v1/events whenever the server is reachable.

  • No Wi-Fi detection: try whenever any network is connected. That covers the home network, Tailscale and public servers alike. An unreachable server leaves the buffer untouched and is retried later.
  • Triggers: periodic (hourly, network connected), a retry with backoff after a network failure, and right away when the app is opened.
  • Batches of at most 500 events / 512 KiB. Drop events on accepted or duplicate; drop rejected ones and log only the reason code.
  • 429: keep the batch, wait for Retry-After.
  • 401: stop all device requests, keep the buffer, show "pair this device again". No retry on a timer.
  • GET /api/v1/device/me once at app start for the clock skew, never polled.
  • Events older than the server's window (90 days by default) are rejected by the server (start_ts_too_old) and dropped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions