Skip to content

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

Merged
nan-li merged 2 commits intomainfrom
feat/add_sub_id_header_to_user_create
Mar 4, 2024
Merged

Add OneSignal-Subscription-Id to Create User request#1372
nan-li merged 2 commits intomainfrom
feat/add_sub_id_header_to_user_create

Conversation

@nan-li
Copy link
Copy Markdown
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
Copy Markdown
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.

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