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

[user model] Fix firing the push subscription observer #1211

Conversation

nan-li
Copy link
Contributor

@nan-li nan-li commented Jan 12, 2023

Description

One Line Summary

Fix bug in firing the push subscription observer, two methods were not correct.

Details

Motivation

  • calculateIsOptedIn and calculateIsEnabled were not actually using the passed in arguments, and these methods were using the instance variables.

Scope

Bug fix for firing push subscription observer.

Testing

Manual testing

Manual testing of push subscription observer behavior:

  1. Install app, fires twice for token and subscriptionId
  2. prompt for push, fires once for the optedIn flag

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

* calculateIsOptedIn and calculateIsEnabled were not actually using the passed in arguments
@nan-li nan-li changed the base branch from main to major_release_5.0.0 January 12, 2023 21:07
@nan-li nan-li changed the base branch from major_release_5.0.0 to user_model/fix_identify_user_and_push_observer January 12, 2023 21:07
@nan-li nan-li changed the title User model/fix push observer [user model] Fix firing the push subscription observer Jan 12, 2023
@nan-li nan-li merged commit 9b6a9af into user_model/fix_identify_user_and_push_observer Jan 12, 2023
@nan-li nan-li deleted the user_model/fix_push_observer branch January 12, 2023 21:41
nan-li added a commit that referenced this pull request Oct 30, 2023
[user model] Fix firing the push subscription observer
nan-li added a commit that referenced this pull request Oct 30, 2023
[user model] Fix firing the push subscription observer
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