How it works
Each committed change adds an ordered event for its account or namespace: file ID, revision, operation, and sequence. A device saves a cursor, the position of its last applied event. On reconnect it requests paginated changes after that cursor, applies them, and advances the cursor only after local state is durable. An expired cursor requires a consistent snapshot followed by later changes. Shared-file updates must enter each authorized recipient’s change view; revocation removes the file from that view without exposing new content.
Consider a laptop with cursor 5,120. A phone commits two edits, events 5,121 and 5,122. The laptop gets a hint, requests changes after 5,120, applies both, and saves 5,122. If it crashes before saving, it asks again from 5,120, so applying an event twice must be harmless.
Push, long polling (a request the server holds open until something changes), or WebSocket can alert an online device. Signals may be duplicated or missed, so clients pull the authoritative change log and also poll now and then. The receiving device fetches metadata, downloads only missing blocks, and rebuilds the revision. Access revocation must stop protected downloads even when an old object key is known. Dropbox’s list_folder endpoints and Google Drive’s changes API both hand clients a cursor or page token in this style. The cost is log retention: longer history spares more devices a full snapshot but takes more storage.
A laptop is offline for a week and misses thousands of pushes. How does it catch up?
Request changes after its persisted cursor. If history expired, fetch a consistent snapshot and resume from its boundary.
Use this as a guide for self review; written answers are not graded.Keep in mind
- Durable cursors recover missed changes after offline periods.
- Notifications prompt a pull; they are not the complete file state.