Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deeplinks): get url from the correct field for CT events #6356

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

satish-ravi
Copy link
Contributor

Description

Per this update in clever tap docs, this likely slipped through on a clevertap package upgrade

Test plan

Can't easily test CT push notifications with a dev build, but this has been working on Android, where the url was extracted correctly, and also confirmed with logging on iOS that the deeplink field is present at the top level of the event.

Also tested the 2 callbacks being called scenario by updating the code to call handleOpenUrl twice (one with isSecureOrigin: false and the other with true) in the Linking event listener, the 2nd call mimics the call that would've been done by the CT push notification listener callback, and also introducing a delay in the saga (to mimic slow sagas, which can be killed by takeLatest if another event of the same action type is fired). On opening a deeplink on the browser with an openScreen deeplink and the app backgrounded, confirmed that the navigation to the correct screen happens.

Related issues

Backwards compatibility

Yes

Network scalability

N/A

Copy link
Collaborator

@MuckT MuckT left a comment

Choose a reason for hiding this comment

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

The explanation in the PR and code comments were very helpful for understanding the underlying issue and the fix 🚀

Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 88.97%. Comparing base (5bde01c) to head (41cf6eb).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/app/saga.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6356      +/-   ##
==========================================
+ Coverage   88.92%   88.97%   +0.05%     
==========================================
  Files         735      735              
  Lines       31366    31402      +36     
  Branches     5821     5832      +11     
==========================================
+ Hits        27892    27940      +48     
+ Misses       3276     3266      -10     
+ Partials      198      196       -2     
Files with missing lines Coverage Δ
src/app/useDeepLinks.ts 69.33% <100.00%> (+16.00%) ⬆️
src/app/saga.ts 70.61% <0.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bde01c...41cf6eb. Read the comment docs.

@satish-ravi satish-ravi merged commit f52bc0f into main Dec 12, 2024
14 of 15 checks passed
@satish-ravi satish-ravi deleted the satish/act-1469-fix-CT-deeplink branch December 12, 2024 23:02
MuckT pushed a commit that referenced this pull request Dec 17, 2024
### Description

Per this
[update](https://github.com/CleverTap/clevertap-react-native/blob/2c2ab9664b9e83cde936d14b511896d7edd5ecdc/docs/callbackPayloadFormat.md?plain=1#L12)
in clever tap docs, this likely slipped through on a clevertap package
upgrade

### Test plan

Can't easily test CT push notifications with a dev build, but this has
been working on Android, where the url was extracted correctly, and also
confirmed with logging on iOS that the deeplink field is present at the
top level of the event.

Also tested the 2 callbacks being called scenario by updating the code
to call handleOpenUrl twice (one with isSecureOrigin: false and the
other with true) in the Linking event listener, the 2nd call mimics the
call that would've been done by the CT push notification listener
callback, and also introducing a delay in the saga (to mimic slow sagas,
which can be killed by `takeLatest` if another event of the same action
type is fired). On opening a deeplink on the browser with an openScreen
deeplink and the app backgrounded, confirmed that the navigation to the
correct screen happens.

### Related issues

- Fixes ACT-1469

### Backwards compatibility

Yes

### Network scalability

N/A
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