1554 Commits
Author SHA1 Message Date
Julius van der VaartandClaude Opus 5.5 1e8c855a66 perf(file-provider): read a new directory inside a pinned folder in the same scan
The working-set scan only descends into a changed child directory when
something inside it is already materialised, which keeps one push from
walking whole never-visited subtrees on a sparse domain. A directory
created on the server inside a pinned folder can never pass that test,
because nothing inside it is known yet, so the extension did not report
its contents. fileproviderd still lists the pinned folder and downloads
its files on its own background cycle, which took about a minute in a
manual test and can take longer when macOS defers background work.

"Always keep downloaded" asks for the whole subtree, so the scan now
descends when the child carries the pin, and the files are reported in
the same scan. The bound holds everywhere else.

The pin is read from the stored row, because the read applies the
parent's pin to a new row on its own copy, so the metadata it hands back
still has the value from before.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Julius van der Vaart <[email protected]>
2026-11-06 13:23:50 +01:00
Claudio Cambra 036bd1862c Merge pull request #11232 from juliusvaart/macos/vf/folder-add-capability
Allow adding items to a folder only when the server permits it
2026-11-06 10:48:03 +08:00
Claudio Cambra eaae00706c fix(file-provider): isolate shared capabilities request options
Fetch capabilities with default request options when sharing the request by account. Keep file-specific upload preconditions on the upload so they cannot affect other callers waiting for capabilities.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:56:20 +08:00
Claudio Cambra 9e4eaae057 refactor(file-provider): use one cancellation check for item lookups
Default to the Swift task state. File Provider callers can supply
their operation cancellation check, which already covers the
worker task and Progress.

Cover a plain Swift task cancelled before the parent lookup starts.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:56:20 +08:00
Claudio Cambra a1d7c3145f fix(file-provider): roll back cancelled parent lookup writes
Pass live cancellation state through the parent lookup. Check it
before saving retrieved metadata and again before committing it.
Use the async writer so a cancelled Swift task can also stop while
waiting for the database.

Cover cancellation before persistence and after insertion.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:56:19 +08:00
Claudio Cambra bfe06a4d87 fix(file-provider): reject single-file fetches after a move
Check the starting path and ETag before publishing a file download.
A move can preserve the ETag while changing the parent of the
returned item.

Test that the original fetch fails and a retry returns the new parent
when the move is recorded before publication.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:41 +08:00
Claudio Cambra 1dfad8993d fix(file-provider): preserve pending uploads during paginated enumeration
Keep the stored metadata for an active or failed upload while its local
edit is pending. A paginated listing can describe a newer server copy
before the local contents have been uploaded.

Cover a changed server copy during an upload and a second listing after
cancellation.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:41 +08:00
Claudio Cambra d716ce99fb fix(file-provider): refresh alias types on folder retries
Refresh a file's content type when the listed ETag differs from
the row read at the start of the download. Recheck known aliases
against the new bytes because a server listing can describe them
as generic files.

Cover an alias replaced by text, an alias with the same ETag, and
an alias updated to a new version.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:41 +08:00
Claudio Cambra a9fbf84eb0 fix(file-provider): classify folder fetches from current metadata
Use the row read by beginDownload for the download path and package
classification. Share the filename and type rules with Item.

Keep deleted package members deleted until the whole folder fetch
commits. A rename after listing or during a member transfer can
invalidate the fetch after it has already seen the old package path.

Cover renames before the fetch in both directions, after listing, and
during transfer. Verify that a deleted nested directory can still be
downloaded when its own listing reports a newer ETag.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:41 +08:00
Claudio Cambra c60076fe6a fix(file-provider): preserve pin changes when uploads fail
Record the failure on the current uploading row so changes made
during the transfer survive. Clear a stale lock token only when
it still matches the token used by the request.

Cover pinning and unpinning during chunk preparation followed by
cancellation.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:15 +08:00
Claudio Cambra b50b3102d4 fix(file-provider): check cancellation before publishing downloads
Check cancellation after acquiring the writer and before recording
materialization. Read the Progress state directly so the check can
observe cancellation before the handler runs.

Cover a file cancelled while waiting for the writer and a folder
cancelled during the transaction. Verify both discard their temporary
contents and leave the rows undownloaded.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:15 +08:00
Claudio Cambra 4d3cb2cac3 fix(file-provider): report failed download completion writes
Return cannotSynchronize when a completion write produces an error
outside the domains File Provider accepts. Keep the original error
description for download cleanup.

Reject the success write in a regression test and verify the file
leaves the downloading state, the temporary contents are removed,
and a retry succeeds once writes recover.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:15 +08:00
Claudio Cambra e4eb3ab907 fix(file-provider): preserve newer moves during folder downloads
Check child metadata before starting a transfer and record each
download's starting path and ETag. Validate those snapshots and the
listed paths in the folder completion transaction so a concurrent
listing cannot be overwritten by an older download.

Cover a child moved during transfer, a listing that becomes stale
before transfer, and a replacement item at the listed path.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:15 +08:00
Claudio Cambra ffe3f25d4b fix(file-provider): reject downloads with a changed ETag
Compare the current ETag with the one captured at the start of the
fetch in the transaction that marks the file downloaded. Keep
ownership on failure so cleanup can discard the temporary contents
and preserve the newer ETag for retry.

Cover a concurrent paginated folder listing that updates the ETag
after the older bytes reach disk, then verify that retry returns
the new contents and version.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:15 +08:00
Claudio Cambra ecf2427eb6 style(file-provider): remove unrelated formatting edits
Restore the surrounding imports and layout so the diff focuses on cancellation.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:14 +08:00
Claudio Cambra 21570f627a refactor(file-provider): remove obsolete capabilities waiters
Keep the shared capabilities request as the single waiting path. Exercise
shared request cancellation and reset through that path in tests.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:14 +08:00
Claudio Cambra 1e5fc29336 fix(file-provider): discard cancelled metadata reads
Check for cancellation after the request and before writing converted
directory metadata so late responses cannot update the database.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:55:14 +08:00
Claudio Cambra 6f4272cb39 fix(file-provider): validate paths and identities during fetch
Use the current row to resolve the path and parent. Check the directory ID
before ingesting its listing and retry when a descendant disappears.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:41 +08:00
Claudio Cambra 178aa83c11 fix(file-provider): publish current download metadata
Save the listing used by a folder fetch in the completion transaction.
Preserve current local state and return the committed metadata to File Provider.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:40 +08:00
Claudio Cambra 9045b0de96 fix(file-provider): adapt download cancellation to GRDB
Use persisted store identity to share download ownership across reopened
managers. Restore package members and publish completed folder downloads
in GRDB transactions while retaining local metadata and ownership checks.

Port database regressions and chunk assertions to the current test APIs.
Preserve store identity during fixture resets and recover test schemas
without relying on cached table-existence information.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:40 +08:00
Claudio Cambra 39297e0356 fix(file-provider): use current server paths for folder downloads
Use the database to filter deleted children, then transfer live children
using the current server listing. Preserve stored local metadata and
missing-row checks instead of replacing fresh paths with stale fields.

Cover renamed-member retries for ordinary folders and packages, and
selection across transfer states without changing database rows.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:40 +08:00
Claudio Cambra ac7a66ca98 fix(file-provider): restore listed package members during download
Restore missing or inactive deleted member rows through a dedicated
helper for package downloads. Preserve local metadata, cancellation and
ownership checks. Keep ordinary directory downloads' tombstone
selection unchanged.

Use current server listings for package transfer paths, including
renamed members on retry and nested folders within packages.

Cover package exclusion and reappearance, package and ordinary
directory boundaries, cancellation, ownership and atomic restoration.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:40 +08:00
Claudio Cambra cc45b28a27 fix(file-provider): preserve non-cancelled chunk preparation errors
Treat NextcloudKit's overloaded -5 code as cancellation only when the
upload operation was cancelled. Preserve other preparation failures,
including empty chunks, instead of reporting userCancelled.

Cover both File Provider error mappers and the upload workflow while
retaining actual cancellation and committed assembly result coverage.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:40 +08:00
Claudio Cambra 8848cceb36 fix(file-provider): publish folder download state atomically
Keep child download ownership until the folder is ready to return, then
publish the folder and all children in one Realm transaction. Discarded
fetches clear only the state they still own, preserving newer results
and recorded transfer errors.

Cover partial failure, cancellation during final lookups, supersession
and atomic publication failure.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:40 +08:00
Claudio Cambra 461a05c737 fix(file-provider): report missing folder children as retryable errors
Map missing child metadata at download completion to cannotSynchronize
instead of reporting the requested parent folder as missing. Keep direct
file completion and missing requested-folder errors unchanged.

Reproduce a parent enumeration marking an active child deleted after its
contents arrive, covering files and nested folders.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:13 +08:00
Claudio Cambra c595eefb97 fix(file-provider): isolate folder download destinations
Use a unique temporary destination for each folder fetch and remove
unreturned contents after failure or cancellation. Retries cannot reuse
partial contents or overwrite a previously returned folder.

Cover retries after partial failure and cancellation, successive fetches,
and cleanup of unreturned directories.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:13 +08:00
Claudio Cambra 12be3f09de fix(file-provider): preserve deletions during folder downloads
Select children from persisted metadata without undeleting or recreating
records. Skip deleted subtrees and retain nested directory ownership
through traversal so late deletions cannot be overwritten.

Cover deleted children, missing records, late deletions, and nested
folder success, failure and cancellation.

Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:13 +08:00
Claudio Cambra aeefe0f4fb test(file-provider): bound account waiter cancellation checks
Bound both waiter registration and task completion with the existing
async test helpers. Release any stranded account waiter during cleanup
so a cancellation regression fails instead of hanging the test run.

Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:12 +08:00
Claudio Cambra 9390205721 fix(file-provider): limit deleted row restoration to folder downloads
Keep unchanged local tombstones during ordinary depth-1 reads. Restore
listed file rows only for an explicit folder download, before transfers
start, without rewriting live or in-flight metadata.

Cover ignored files, excluded bundles, missing rows, local state and
deletions made after the directory listing.

Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:12 +08:00
Claudio Cambra 1fa0fa2591 test(file-provider): cover cancellation during successful chunk assembly
Verify create and modify persist completed chunked uploads despite
cancellation, including the server identity, ETag and chunk cleanup.

Reopen Realm after the async modify before checking chunk rows so the
existing exclusion test does not access a Realm from another thread.

Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:12 +08:00
Claudio Cambra 795cace700 chore(deps): update NextcloudKit to 7.6.3
Require the release that preserves committed chunk-upload results when
cancellation arrives during assembly.

Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:12 +08:00
Claudio Cambra 4e71713456 fix(file-provider): Handle superseded download requests correctly
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:12 +08:00
Claudio Cambra 1b716db92c fix(file-provider): Do not return cancellation error for superseded download
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:12 +08:00
Claudio Cambra 0a93f41a98 fix(file-provider): Remove unused thumbnail wrapper
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:12 +08:00
Claudio Cambra d0f7b0d261 fix(file-provider): Strengthen account-wait cancellation test by properly waiting for account setup
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:11 +08:00
Claudio Cambra 4bcabf521f fix(file-provider): Do not cancel entire shared capabilities fetch when more than one task depends on it
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:11 +08:00
Claudio Cambra 78642d399c fix(file-provider): Add test coverage for cancellations in small and chunked uploads through upload, create and modify
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:11 +08:00
Claudio Cambra 09b4d1eaee fix(file-provider): Test chunk preparation cancellation handling
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:11 +08:00
Claudio Cambra 0128eed601 fix(file-provider): Handle chunk construction cancellation result from NextcloudKit
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:10 +08:00
Claudio Cambra ef24d61f5c fix(file-provider): Do not report cancellations as errors
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:10 +08:00
Claudio Cambra f1072b761b fix(file-provider): Clear stale deleted flags on enumeration
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:10 +08:00
Claudio Cambra ab98944f39 fix(file-provider): Verify cancelled download items have stable state for later changes
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:10 +08:00
Claudio Cambra 18b1c1ec9a fix(file-provider): Ensure cancelled items have download status set back to normal, downloaded set to false, no session error
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:10 +08:00
Claudio Cambra 15bce9627f fix(file-provider): Fix capabilities retrieval actor test by adding timeout, waiting for actual registration
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:10 +08:00
Claudio Cambra 7c520db4cc fix(file-provider): Use identifiers as filenames in fetch tests, avoid overlapping names
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:10 +08:00
Claudio Cambra c4cc2579ae fix(file-provider): Deduplicate db retaining procedure in tests
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:09 +08:00
Claudio Cambra 5da2a3f321 fix(file-provider): Add AsyncTestSupport, make missing cancellation fail instead of hanging
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:09 +08:00
Claudio Cambra 351e7d680a fix(file-provider): Ensure superseded download does not return download contents
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:09 +08:00
Claudio Cambra d5dbe11e96 fix(file-provider): Retain dbmanager out of task block in fetch tests
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:09 +08:00
Claudio Cambra 649c68ba16 fix(file-provider): Prevent overlapping fetches that finish out-of-order from overwriting what is newer state
Signed-off-by: Claudio Cambra <[email protected]>
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
2026-11-06 00:54:09 +08:00