fix (fileprovider): Consume lock ETags before File Provider content updates - #10641
Conversation
i2h3
left a comment
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
4748fd4 to
0043b2c
Compare
|
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. |
|
|
@i2h3 problems are solved. It is building. and the test is confirmed that it is working as expected not. |
|
/backport to stable-34.0 |



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