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 #1911

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

nan-li
Copy link
Contributor

@nan-li nan-li commented Nov 14, 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

Country and IP were missing on newly created users, and only set after they have a second session. Now, they will have country and IP on creation.

Scope

Country and IP are based on where the request originated from.

Testing

Unit testing

None

Manual testing

Android emulator on API 33

  • tested new app install and seeing country and IP exist on the user
  • previous to this PR, testing a new app install 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

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 merged commit a5bfd21 into user-model/main Nov 17, 2023
2 checks passed
@nan-li nan-li deleted the add_refresh_device_metadata_to_create_user branch November 17, 2023 00:13
@jennantilla jennantilla mentioned this pull request Dec 1, 2023
jinliu9508 pushed a commit that referenced this pull request Jan 31, 2024
…o_create_user

Add refresh_device_metadata to create user so country / IP can be set
jinliu9508 pushed a commit that referenced this pull request Jan 31, 2024
…o_create_user

Add refresh_device_metadata to create user so country / IP can be set
jinliu9508 pushed a commit that referenced this pull request Feb 6, 2024
…o_create_user

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