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(messaging, ios): ensure getInitialNotification returns null vs undefined per types #5926

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

chuganzy
Copy link
Contributor

@chuganzy chuganzy commented Dec 10, 2021

Description

On iOS, getInitialNotification in RNFBMessaging+UNUserNotificationCenter.m can be nil so getInitialNotification can be undefined. However TS definition says it is Promise<RemoteMessage | null>.
I first was thinking of correcting this type definition, however as it will be a breaking change, fixed the proxy layer instead.

Related issues

None.

Release Summary

None.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan

Automated tests should cover already.


Think react-native-firebase is great? Please consider supporting the project with any of the below:

@CLAassistant
Copy link

CLAassistant commented Dec 10, 2021

CLA assistant check
All committers have signed the CLA.

@vercel
Copy link

vercel bot commented Dec 10, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

react-native-firebase – ./

🔍 Inspect: https://vercel.com/invertase/react-native-firebase/CUXcusK2HQZv89Y9m7kvKRAfb8Ad
✅ Preview: https://react-native-firebase-git-fork-chuganzy-messag-9b730e-invertase.vercel.app

react-native-firebase-next – ./website_modular

🔍 Inspect: https://vercel.com/invertase/react-native-firebase-next/FLSnQRJwAqbi4N2xwr31zbDDaQXT
✅ Preview: Canceled

[Deployment for fdae945 canceled]

@mikehardy mikehardy added the Workflow: Waiting for User Response Blocked waiting for user response. label Dec 10, 2021
@mikehardy mikehardy changed the title fix(messaging): map getInitialNotification's value as it can be undefined fix(messaging, ios): ensure getInitialNotification returns null vs undefined per types Dec 10, 2021
Copy link
Collaborator

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

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

LGTM - thank you! Shame there's no single doc, I should really PR something to the reactnative.dev site...would be handy

@mikehardy mikehardy added Workflow: Pending Merge Waiting on CI or similar and removed Workflow: Waiting for User Response Blocked waiting for user response. labels Dec 10, 2021
@codecov
Copy link

codecov bot commented Dec 10, 2021

Codecov Report

Merging #5926 (a432f2b) into main (0a9621b) will increase coverage by 28.02%.
The diff coverage is 75.00%.

❗ Current head a432f2b differs from pull request most recent head fdae945. Consider uploading reports for the commit fdae945 to get more accurate results

@@              Coverage Diff              @@
##               main    #5926       +/-   ##
=============================================
+ Coverage     24.61%   52.63%   +28.02%     
- Complexity        0      625      +625     
=============================================
  Files            97      208      +111     
  Lines          4230    10157     +5927     
  Branches       1026     1612      +586     
=============================================
+ Hits           1041     5345     +4304     
- Misses         2587     4556     +1969     
+ Partials        602      256      -346     

@mikehardy
Copy link
Collaborator

was having issues getting this to run through CI for various unrelated reasons. I just pulled it and ran it locally, everything checks out, thanks again!

@mikehardy mikehardy merged commit f0318d2 into invertase:main Dec 14, 2021
@mikehardy mikehardy removed the Workflow: Pending Merge Waiting on CI or similar label Dec 14, 2021
@chuganzy chuganzy deleted the messaging-fix-type branch December 18, 2021 02:43
@chuganzy
Copy link
Contributor Author

Completely overlooked the merge notification! Thanks for reviewing and merging so quickly!

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