fix (fileprovider): Consume lock ETags before File Provider content updates - #10641
Open
Rello wants to merge 1 commit into
Open
fix (fileprovider): Consume lock ETags before File Provider content updates#10641Rello wants to merge 1 commit into
Rello wants to merge 1 commit into
Conversation
Rello
marked this pull request as ready for review
August 25, 2026 20:05
Rello
requested review from
camilasan,
claucambra,
i2h3,
mgallien and
nilsding
as code owners
August 25, 2026 20:05
i2h3
requested changes
Aug 26, 2026
i2h3
left a comment
Collaborator
There was a problem hiding this comment.
And Nextcloud Desktop Client.xcworkspace/xcshareddata/swiftpm/Package.resolved contains wrong hashes.
Signed-off-by: Rello <github@scherello.de> Assisted-by: Codex:GPT-5
Rello
force-pushed
the
bugfix/fileproviderfilelock
branch
from
August 26, 2026 15:56
4748fd4 to
0043b2c
Compare
Contributor
|
Artifact containing the AppImage: nextcloud-appimage-pr-10641.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
|
Collaborator
Author
|
@i2h3 problems are solved. It is building. and the test is confirmed that it is working as expected not. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



Issue
Opening a Microsoft Word document creates a local Word lock file, which causes the File Provider extension to send a WebDAV
LOCKrequest.The server lock succeeded, but locking also changed the server ETag. The File Provider previously used that ETag for both:
metadataVersioncontentVersionA lock-only ETag change therefore appeared to macOS as changed file contents. File Provider attempted to evict or replace the materialized document while Word still had it open, resulting in
Resource busy,FP -2008, and a Finder cloud/error icon.A second case occurred when the document was already locked by the same client. The
LOCKresponse restored the local token but returned the existing ETag. Because the ETag did not change, macOS did not refresh its cached item metadata. The document remained advertised as non-writable and macOS applied the immutableuchgflag.Fix
The implementation separates server metadata changes from actual file-content changes:
The ETag and token returned by
LOCKare written directly to the target item's metadata.A persisted
fileProviderContentVersionretains the version of the file contents already known to File Provider. A lock-only ETag transition changesmetadataVersionwhile leavingcontentVersionunchanged. A successful upload advances both to the upload ETag.After storing the lock token, the target item's synchronization timestamp is updated and the existing working-set change notifier is triggered. This immediately reports the updated lock capabilities to macOS.
The effective lock-ownership state is included in
metadataVersion. Recovering a local token therefore refreshes the item even whenLOCKreturns the same ETag.Both
capabilitiesandfileSystemFlagsrecognize a locally owned token lock as writable. This prevents macOS from applying the immutableuchgflag.A separate File Provider content version is required. Simply updating the ETag would also change
contentVersion, causing macOS to treat the lock-only transition as changed file contents and attempt another replacement.Dependent on nextcloud/NextcloudKit#249
Assisted-by: Codex:GPT-5