-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Create a debounced autosave feature which uses API to save a new revision of the doc with time and uid. On save, the backend detects conflicts and passes that back to client in the responses. Client reacts to the conflict visually and offers 3 solutions before overwriting conflicted; yours, theirs or merge
User Story
As a user editing a document,
I want my changes to autosave in the background,
So my work is preserved without interruptions and conflicts are handled safely.
Description
Implement a debounced autosave mechanism that periodically saves document changes via an API.
Each save creates a new revision containing timestamp and user ID.
The backend performs conflict detection against the latest revision and returns conflict metadata when detected.
The client visually surfaces conflicts and provides clear resolution options before overwriting.
Acceptance Criteria
-
Autosave behaviour
- Autosave triggers after user inactivity (debounce, e.g. 1–2s).
- No save calls while user is actively typing.
- Autosave is paused during explicit manual save.
-
Revision creation
-
Each autosave creates a new revision with:
revisionIdtimestampuidbaseRevisionId
-
-
API & backend
-
Backend detects conflicts when
baseRevisionIdis stale. -
Conflict response includes:
- latest revision metadata
- diff or conflicting fields
-
No data is overwritten without explicit client confirmation.
-
-
Client conflict handling
-
Conflict state is visually indicated (non-blocking but prominent).
-
User is presented with three explicit options:
- Keep mine (overwrite)
- Use theirs (discard local changes)
- Merge (manual or assisted merge view)
-
Autosave is suspended while conflict is unresolved.
-
-
UX
- Clear status indicators: Saving, Saved, Conflict detected.
- No silent data loss.
- Merge option shows side-by-side or inline diff.
Out of Scope
- Real-time collaborative editing
- Automatic merge logic beyond simple field-level diffs
Notes
- Design API responses to be forward-compatible with live collaboration.
- Conflict UI should be reusable for future multi-user features.
Metadata
Metadata
Assignees
Labels
Projects
Status