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 refresh_device_metadata to create user so country / IP can be set #1339

Merged
merged 1 commit into from Dec 18, 2023

Conversation

nan-li
Copy link
Contributor

@nan-li nan-li commented Nov 15, 2023

Description

One Line Summary

Add refresh_device_metadata to create user so country and IP can be set for the new user.

Details

When the server receives a create user request, it doesn't automatically update IP and country for this user because this request can come from the SDK or from the customer's server.

By passing in a refresh_device_metadata = true property to the request body, we can let the server know to update IP and country based on where the request originated from.

Motivation

This flag was added to the create user endpoint and while missing country / IP didn't affect iOS as it did Android, because iOS made a followup session call immediately, let's still add this to our create user request for consistency.

Scope

Country and IP are based on where the request originated from. This change is not really necessary for iOS due to differing behavior but consistency-wise and future proofing, it is good to have this flag on the create user request.

Testing

Unit testing

None

Manual testing

iPhone 13 iOS 17.1

  • tested new app install and seeing country and IP exist on the user
  • previous to this PR, testing a new app install (and not allowing a followup session call) does not include country and IP on the user

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

@nan-li nan-li closed this Dec 18, 2023
@nan-li nan-li force-pushed the add_refresh_device_metadata_to_create_user branch from 14c17da to afb165c Compare December 18, 2023 18:09
When the server receives a create user request, it doesn't automatically update IP and country for this user because this request can come from the SDK or from the customer's server.
By passing in a `refresh_device_metadata = true` property to the request body, we can let the server know to update IP and country based on where the request originated from.
@nan-li nan-li reopened this Dec 18, 2023
@nan-li nan-li merged commit 4b92542 into main Dec 18, 2023
7 checks passed
@nan-li nan-li deleted the add_refresh_device_metadata_to_create_user branch December 18, 2023 21: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.

None yet

3 participants