fix(android): correct long term access directory picker response #823
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR: Rename 'status' key to 'bookmarkStatus' in Android directory picker response
Description
This PR standardizes the response format for directory picking on Android by renaming the
status
key tobookmarkStatus
whenrequestLongTermAccess
is set totrue
. This change ensures consistency across platforms and aligns with the expected type definitions.Changes Made
processDirectoryPickerResult()
method inRNDocumentPickerModule.kt
to usebookmarkStatus
instead ofstatus
in the response object when handling long-term directory access permissionsreleaseLongTermAccess()
method to also usebookmarkStatus
instead ofstatus
in the response for consistencyTechnical Details
The changes were made in two specific locations in
packages/document-picker/android/src/main/java/com/reactnativedocumentpicker/RNDocumentPickerModule.kt
:In the
processDirectoryPickerResult()
method (~line 392-399):In the
releaseLongTermAccess()
method (~line 352-358):Example Usage
When using
pickDirectory()
with long-term access:Previous Response Format (Incorrect)
Fixed Response Format (Correct)
Testing
bookmarkStatus
instead ofstatus
whenrequestLongTermAccess
is trueImpact
This change ensures consistent naming conventions, improving maintainability and cross-platform compatibility by aligning the Android implementation with the expected type definitions used across the library.