Repository navigation
Sync doc revisions: keep the last 20 replaced versions per doc, list + restore - #7
Merged
Merged
Conversation
…+ restore
Every accepted overwrite of a sync_docs row first copies the old row (sealed bytes, same AAD)
into sync_doc_revisions (migration 0015), newest 20 kept per (user, domain). Optional
X-Copper-Build header is stored with each write. New: GET /v1/sync/docs/{domain}/revisions,
GET .../revisions/{version}, POST .../revisions/{version}/restore (writes it back as a new
version, doc event with device_id null). CLI: copper-cloud admin docs revisions|restore.
features: doc_revisions. Device delete also drops its tabs revisions.
Server half of the spaces-unfiling incident (feads cu-y5o / cu-2th).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Server guard for the Copper spaces-unfiling incident (cu-2th): the server can't read docs, so it keeps what each write replaced.
0015_sync_doc_revisions.sql:sync_doc_revisions(user_id, domain, version, device_id, client_build, updated_at, replaced_at, sealed payload) + nullablesync_docs.client_build. Additive; older clients unaffected.X-Copper-Buildoptional header stored per write.GET /v1/sync/docs/{domain}/revisions(metadata),GET …/revisions/{version}(payload),POST …/revisions/{version}/restore(new version +docevent with device_id null so all devices pull).copper-cloud admin docs revisions|restore --user --domain [--version].features:doc_revisions; docs/api.md updated.tests/api.rs::sync_doc_revisions(archive, build header, stale write, restore + event, isolation, prune to 20, tabs 403, device delete, CLI restore).