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

Add OneSignal-Subscription-Id to Create User request #1372

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

nan-li
Copy link
Contributor

@nan-li nan-li commented Feb 15, 2024

Description

One Line Summary

Add the OneSignal-Subscription-Id header to Create User requests.

Details

Motivation

  • This was an ask of the SDK to support improved last_active tracking subscriptions that were actually active
  • What is currently happening is all subscriptions for this user were getting last_active updated.
  • Now, only the subscription that made the create user request is updated.
  • Also, changed a detail of User Update request to not be blocked if subscription ID header could not be added (may be missing subscription ID for example)

Scope

  • Changed the Update User requests to not be blocked if missing subscription-ID
  • A header in Create User requests for backend to process
  • I tested with server changes that only the device making the call has last_active updated.

Testing

Unit testing

None, we can add in future to make sure headers are included.

Manual testing

  1. Building and running on iPhone 13 with iOS 17.2.
  2. Change SDK version and call login while already logged into an identified user (this will send a Create User request)
  3. With debug on, confirm the subscription ID is added to the request
  4. Checked dashboard that only this subscription is updated

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
  • 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.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

- This was an ask of the SDK to support improved `last_active` tracking subscriptions that were actually active
- Moved the helper method to add this header out of User Update so it can be accessed also by Create User
* In the preparation step for a User Update request, adding the push subscription ID header was actually blocking if it is not available.
* This probably shouldn't block updates.
@nan-li
Copy link
Contributor Author

nan-li commented Feb 24, 2024

Just tested today with server changes completed that last_active is now only updating the subscription making the request, instead of all subscriptions for the user.

@nan-li nan-li merged commit 851af0e into main Mar 4, 2024
4 checks passed
@nan-li nan-li deleted the feat/add_sub_id_header_to_user_create branch March 4, 2024 20:48
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