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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
Restore the surrounding imports and layout so the diff focuses on cancellation.
Assisted-by: Codex:GPT-6
Signed-off-by: Claudio Cambra <[email protected]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>
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]>