Skip to content

fix: avoid races during interactive drive acceptance#4720

Merged
shepilov merged 1 commit intomasterfrom
fix/409_error_on_autoaccept
Apr 9, 2026
Merged

fix: avoid races during interactive drive acceptance#4720
shepilov merged 1 commit intomasterfrom
fix/409_error_on_autoaccept

Conversation

@shepilov
Copy link
Copy Markdown
Contributor

@shepilov shepilov commented Apr 1, 2026

What happend:

  • alice@twake.app created the shared drive invitation, at that point, the recipient's Cozy URL(bob@twake.app) was not yet registered on the owner side, so the system only sent the discovery email link
  • because there was no recipient-side sharing request yet, trusted-domain auto-accept job had nothing to accept yet
  • bob@twake.app clicked the discovery link from the email
  • the discovery flow created the recipient-side sharing request with PUT /sharings/:id on the recipient Cozy, as soon as that request arrived, the recipient recognized the sender as trusted (linagora.com) and enqueued drive auto-accept.
  • the browser then continued into the normal manual acceptance route: GET /auth/authorize/sharing?....
  • both paths then touched the same sharing on the recipient side
  • the sharing was actually accepted, and the owner side received a successful /answer, but the browser/manual path hit a stale CouchDB revision conflict and returned a 409 page.

Changes

  • mark discovery/authorize acceptance as interactive(without auto-acceptance flow)
  • make SendAnswer idempotent on conflicts

@shepilov shepilov requested a review from a team as a code owner April 1, 2026 15:33
@shepilov
Copy link
Copy Markdown
Contributor Author

shepilov commented Apr 1, 2026

also, the next step will be this issue #4721

@shepilov shepilov force-pushed the fix/409_error_on_autoaccept branch from 1b9683c to 74b678e Compare April 7, 2026 11:35
@shepilov shepilov force-pushed the fix/409_error_on_autoaccept branch from 74b678e to 3314179 Compare April 9, 2026 12:22
@shepilov shepilov merged commit b7a9302 into master Apr 9, 2026
4 checks passed
@shepilov shepilov deleted the fix/409_error_on_autoaccept branch April 9, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants