Skip to content

Conversation

@vonovak
Copy link
Member

@vonovak vonovak commented Nov 30, 2025

The pick, pickDirectory, and saveDocument functions were using both
promiseWrapper.trySetPromiseRejectingIncoming() to set the promise
and direct promise.reject() calls in catch blocks. This led to an
inconsistent state where the promiseWrapper would still hold a reference
to the rejected promise, causing subsequent calls to automatically reject.

Changed all promise.reject() calls in catch blocks to use
promiseWrapper.reject() to ensure proper cleanup of the wrapper state.

…d saveDocument

The pick, pickDirectory, and saveDocument functions were using both
promiseWrapper.trySetPromiseRejectingIncoming() to set the promise
and direct promise.reject() calls in catch blocks. This led to an
inconsistent state where the promiseWrapper would still hold a reference
to the rejected promise, causing subsequent calls to automatically reject.

Changed all promise.reject() calls in catch blocks to use
promiseWrapper.reject() to ensure proper cleanup of the wrapper state.
@changeset-bot
Copy link

changeset-bot bot commented Nov 30, 2025

🦋 Changeset detected

Latest commit: be41a87

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@react-native-documents/picker Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Updated promise handling in pick, pickDirectory, and saveDocument functions.
@vonovak
Copy link
Member Author

vonovak commented Nov 30, 2025

Claude code works pretty well for coding on the go😃

@vonovak vonovak merged commit 2e79028 into main Nov 30, 2025
4 checks passed
@vonovak vonovak deleted the claude/fix-kotlin-promise-handling-01Wgj9vGKNNaiqibJ2h2rb6d branch November 30, 2025 14:39
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.

3 participants