Files
AFFiNE/packages/frontend/client
DarkSky db948a8c31 feat(client): add account lifecycle, space sync, and cloud upload
Add the credential vault port and the auth coordinator. A refresh
stores its attempt before the request and swaps in the result by
generation. A retry after a crash sends the same attempt ID, a version
4 UUID, with the same credential.

A refresh that the server rejected stays rejected for every later
caller until a new sign-in.

An expired session keeps local edits and resumes them after the same
account signs in. A sign-out with unsynced changes waits for one of
three choices. The session ends only after the host stores a copy.

A revoked permission stops sync and seals the data of the account. A
first sign-in takes a random session epoch.

Add the shared sign-in flow with a resend cooldown, an OAuth state
check, and captcha gates.

Number the pushes of each document on its own, densely from 1. A
reopened session continues after the highest sequence in storage and
keeps the receipts that arrived out of order.

Make the server registry take the platform. Reject endpoints with user
information. On Android, permit plain HTTP only for loopback and
private addresses.

Add workspace and user space subscriptions with a 16-page window. A
subscription counts only after the peer accepted it. Add an awareness
bridge that publishes at most once per 60 ms and waits while offline.

Add a blob queue that checks content hashes and receipts. Close the
previous connection before a new one, and ignore events of a replaced
connection.

Add the move of a local workspace to the cloud, which never writes to
the local workspace. The create request carries a seed: the local root
and one transient edit by a fresh random client.

The snapshot holds the seed before the request goes out. An unknown
result stops for confirmation, and a restart never sends it again. A
new workspace is the target only when its root covers the seed.

A restart sends copies and deletes without a receipt to the new peer.
A local delete reaches the target. The switch waits for every receipt
and a read-back of the target. A retried push never blocks it.
2026-12-06 00:36:21 +09:00
..