Skip to content

Fix metadata query leaks, scoped gather, and timeouts - #10

Open
saif-ellafi wants to merge 1 commit into
DevCodeSpace:mainfrom
saif-ellafi:query_fix
Open

Fix metadata query leaks, scoped gather, and timeouts#10
saif-ellafi wants to merge 1 commit into
DevCodeSpace:mainfrom
saif-ellafi:query_fix

Conversation

@saif-ellafi

Copy link
Copy Markdown

This PR has been AI generated following a heavy debugging session on certain slowness.
Feedback is welcome.

Summary

  • Stop leaking NSMetadataQuery observers after downloads/gathers (block-based tokens were never removed).
  • Let gather take an optional path prefix and timeout so callers can scan a subdirectory and fail instead of hanging.
  • Fix the scoped-query predicate (missing %K argument) and keep live onUpdate streams running until cancel/timeout.

Test plan

  • gather with no prefix still returns the full container listing
  • gather(relativePathPrefix: …) only returns files under that prefix
  • gather(timeout: …) fails cleanly when metadata never finishes
  • Download completes and does not leave a live metadata query behind (repeat many downloads; no progressive slowdown)
  • With onUpdate, updates keep arriving until the event channel is cancelled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant