Request ID NPE Fix - #69
Merged
Merged
Conversation
Collaborator
|
@ZweWaiYanHtet This also should not be able to pass uppercase UUIDs, is it ok? |
Contributor
Author
iOS should be fine. Let me check Android. |
Contributor
Author
|
It should be fine with both iOS and Android since native side will normalize it but I changed to a stricter regex just in case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Ref: https://github.com/pokepay/pokepay-server/issues/7660
This pull request improves the handling and validation of the optional
requestId(idempotency key) parameter across both the Dart and Android native layers. The main goal is to ensure thatrequestIdis always validated in Dart, enforcing a strict UUID format compatible with both Android and iOS, and to prevent silent failures or inconsistencies in idempotency behavior between platforms.Key changes include:
Validation and Consistency Improvements:
validateRequestIdinlib/parameters/request_id.dartto strictly validaterequestIdagainst the canonical UUID format, ensuring both Android and iOS plugins behave identically and preventing malformed values from reaching the native layer.lib/bank_api/transaction.dart,lib/pokepay_sdk.dart) to applyvalidateRequestIdbefore passingrequestIdto the native plugins, ensuring only valid or null values are sent. [1] [2] [3] [4] [5]Android Native Handling:
PokepaySdkPlugin.java) to use a newparseRequestIdhelper that passes through nulls and delegates all format validation to Dart, preventing silent omission of invalidrequestIdvalues and aligning error behavior with platform expectations. [1] [2] [3] [4] [5] [6]Codebase Maintenance:
request_id.dartmodule where necessary. [1] [2]