Fix 409 (Conflict) causes and handling
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 659
- Forks
- 133
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 110
Description
We used to have 409 responses when the client was not in sync with the server state. But with yjs we can now always apply updates as long as they belong to the same session. Still some users are reporting changes being lost while editing with > 10 people in text. 409 Responses are showing in their logs.
Sync requests
Sync requests can trigger 409 responses if the underlying files etag and mtime differ from the document records values.
This will happen if a file is saved through a different mechanism such as desktop client sync or restoring an old version.
Client side handling
The client will see 409 responses to sync requests and process them as normal responses. This is important so the sync mechnism continues working even if there has been a different update to the file.
The 409 will 'only' cause the editor to display the conflict screen with both options to pick from.
One problem with the current approach is that every sync request that responds with a 409 will include the complete local file. As the sync continues even on conflicts that is actually quite a bit of overhead.
Could they cause removal of content added by the client or another client?
Currently I don't see how.
Save requests
✅ TODO
- create follow up issue for smoother handling of expired sessions
- look into save requests
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the sync request handling described in the issue, including client-side processing of 409 responses and the conflict screen, then inspect the still-unresolved save-request path. Reproduce or review the reported cases involving more than 10 editors and determine whether 409 handling causes unnecessary complete-local-file transfers or lost changes; done means the affected handling is understood and the save-request behavior is covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend-api-design, full-stack
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100