Desktop: Disallow unsharing a folder while sharing is in progress #13551
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.
Summary
This change prevents the "Unshare" button from being clicked while a sync is in progress.
This pull request may resolve #13518, if #13518 is related to a conflict between the share and unshare actions or related to an outdated
jop_share_idproperty on the server.Details
When unsharing a folder, Joplin Server determines which items to mark as deleted based on the
jop_share_idproperty:Details
api/shares/:idcallsmodels.share().delete:joplin/packages/server/src/routes/api/shares.ts
Line 144 in 94725c5
userItem().deleteByShare:joplin/packages/server/src/models/ShareModel.ts
Line 477 in 94725c5
UserItemModel::deleteBy:joplin/packages/server/src/models/UserItemModel.ts
Line 111 in 94725c5
joplin/packages/server/src/models/UserItemModel.ts
Line 200 in 94725c5
jop_share_idproperty:joplin/packages/server/src/models/UserItemModel.ts
Line 66 in 94725c5
Since
jop_share_idcomes from the Joplin clients'share_idproperty, the Joplin clients need to be fully synced for the results of the... .where('items.jop_share_id', '=', shareId)query to match the data present locally.Testing plan
Screen recording
Screencast.from.2025-10-27.10-19-05.webm