Skip to content

feat(SDK-557): bridge Android decryption failure handler to JS - #906

Merged
jferrao-itrbl merged 4 commits into
feature/SDK-548-feature-parityfrom
feature/SDK-557-decryption-failure-handler
Sep 30, 2026
Merged

jferrao-itrbl merged 4 commits into
feature/SDK-548-feature-parityfrom
feature/SDK-557-decryption-failure-handler

Conversation

@jferrao-itrbl

@jferrao-itrbl jferrao-itrbl commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Expose IterableConfig.decryptionFailureHandler (Android-only) and bridge native IterableDecryptionFailureHandler via handleDecryptionFailureCalled.
  • Wire listener registration/cleanup in Iterable.ts, decryptionFailureHandlerPresent in toDict(), tests, CHANGELOG, and public IterableDecryptionFailure type.

Test plan

  • yarn typecheck
  • yarn test
  • Android compileDebugJavaWithJavac — may fail until SDK-749 implements IterableEmbeddedUpdateHandler sync callbacks (see Jira comments on SDK-557 / SDK-749)

Jira

https://iterable.atlassian.net/browse/SDK-557

Expose IterableConfig.decryptionFailureHandler so RN apps can react when
Android keychain PII decryption fails, matching native IterableConfig parity.
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Lines Statements Branches Functions
Coverage: 72%
72.33% (591/817) 62.04% (237/382) 67.55% (177/262)

@qltysh

qltysh Bot commented Sep 24, 2026

Copy link
Copy Markdown

Qlty


Coverage Impact

Unable to calculate total coverage change because base branch coverage was not found.

Modified Files with Diff Coverage (1)

RatingFile% DiffUncovered Line #s
New file Coverage rating: A
src/core/classes/Iterable.ts100.0%
Total100.0%
🚦 See full report on Qlty Cloud »

🛟 Help
  • Diff Coverage: Coverage for added or modified lines of code (excludes deleted files). Learn more.

  • Total Coverage: Coverage for the whole repository, calculated as the sum of all File Coverage. Learn more.

  • File Coverage: Covered Lines divided by Covered Lines plus Missed Lines. (Excludes non-executable lines including blank lines and comments.)

    • Indirect Changes: Changes to File Coverage for files that were not modified in this PR. Learn more.

Avoid RN debug RedBox when apps set decryptionFailureHandler on iOS.
Assert listenerCount in the omitted-callback test.
@jferrao-itrbl
jferrao-itrbl marked this pull request as ready for review September 28, 2026 16:54
@jferrao-itrbl
jferrao-itrbl requested a review from a team as a code owner September 28, 2026 16:54
Comment on lines +97 to +98
if (configReadableMap.hasKey("decryptionFailureHandlerPresent") && configReadableMap.getBoolean("decryptionFailureHandlerPresent") == true) {
configBuilder.setDecryptionFailureHandler(this);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only registers the handler on the first native keychain construction. Android SDK 3.10.1 caches IterableKeychain, whose handler is fixed at construction, so initializing once without this callback and later re-initializing with it leaves the native handler null even though JS installs a listener.

Suggest registering the bridge handler unconditionally while keeping the JS listener conditional, or otherwise refreshing the native keychain handler, and adding a regression test that enables the callback across initializations.

IterableKeychain caches decryptionFailureHandler at first construction.
Register the RN bridge unconditionally; keep the JS listener conditional.

@rtlsilva rtlsilva left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jferrao-itrbl
jferrao-itrbl merged commit 34a55a9 into feature/SDK-548-feature-parity Sep 30, 2026
10 checks passed
@jferrao-itrbl
jferrao-itrbl deleted the feature/SDK-557-decryption-failure-handler branch September 30, 2026 15:43
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.

2 participants