text icon indicating copy to clipboard operation
text copied to clipboard

Fix 409 (Conflict) causes and handling

Open max-nextcloud opened this issue 10 months ago • 3 comments

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

  • [x] create follow up issue for smoother handling of expired sessions
  • [ ] look into save requests

max-nextcloud avatar Feb 19 '25 09:02 max-nextcloud

Recovering a file from old versions triggers 409 requests right now.

Image

MOVE remote.php/dav/versions/max/versions/$FILE_ID/$TIMESTAMP

max-nextcloud avatar Feb 19 '25 10:02 max-nextcloud

https://github.com/nextcloud/text/issues/5473 may also be related?

juliusknorr avatar Feb 24 '25 14:02 juliusknorr

#6918 was also really helpful in reducing the relevance here. Now if i open a text file, make no changes and open the sidebar a revert to a previous version will not cause a conflict view anymore. Instead it shows that the editing session expired and asks the user to reload.

Next step would be making that experience more smooth.

max-nextcloud avatar Mar 14 '25 15:03 max-nextcloud