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/fcm push token bug #2125

Merged
merged 3 commits into from
Jun 17, 2024
Merged

Fix/fcm push token bug #2125

merged 3 commits into from
Jun 17, 2024

Conversation

rgomezp
Copy link
Contributor

@rgomezp rgomezp commented Jun 13, 2024

Description

One line summary: Remove redundant retrievePushToken call and refine local model replacement logic.

Details

Motivation

Remove Unnecessary retrievePushToken Call

The retrievePushToken call in the start function has been removed. Since the config model is replaced every time, this call is redundant.

Replace Local Models with Non-Push Subscriptions

Local models are now only replaced with non-push subscriptions. The backend should sync its push token state with the client state, as the client directly obtains the token during subscription.

Testing

Manual testing

Tested locally.

  • Change project number
  • Send push - failed
  • Open app
  • Send push - success

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

Copy link
Member

@jkasten2 jkasten2 left a comment

Choose a reason for hiding this comment

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

Left some comments, also looks like the failing test is due to this change and has to be updated.

@rgomezp rgomezp requested review from jkasten2 and removed request for brismithers June 17, 2024 17:34
rgomezp and others added 3 commits June 17, 2024 14:31
Motivation: since we're replacing the config model every time, this is already being called. We don't need to call it again in `start`
Motivation: the backend should sync its push token state with the client state (truth) since it's the client that gets the token directly when subscribing -- as opposed to the client syncing with whatever comes in from the backend.
… subscription not being refreshed from backend.
@rgomezp rgomezp merged commit d3b50f1 into main Jun 17, 2024
2 of 3 checks passed
@rgomezp rgomezp deleted the fix/fcm-push-token-bug branch June 17, 2024 19:43
@nan-li nan-li mentioned this pull request Jun 18, 2024
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