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

Fixing a user reported crash on device model code #129

Merged
merged 2 commits into from
Jan 3, 2024

Conversation

ajaysubra
Copy link
Contributor

@ajaysubra ajaysubra commented Jan 2, 2024

Description

Added a check to the device model code to avoid a reported crash. Checking the size before copying over the data to the pointer.

Check List

  • Are you changing anything with the public API?
  • Have you tested this change on real device?
  • Are your changes backwards compatible with previous SDK Versions?
  • Have you added unit test coverage for your changes?
  • Have you verified that your changes are compatible with all the operating system version this SDK currently supports?

Manual Test Plan

Checked on a test app and device model showed up fine on the server for an iPhone 13 mini.

{
  "SDK Version": "2.3.0",
  "Device ID": "XXXX",
  "Total Price": 10.99,
  "OS Version": "17.1.2",
  "OS Name": "iOS",
  "App ID": "com.klaviyo.testiosforbfcm",
  "Device Manufacturer": "Apple",
  "App Name": "testingKlaviyo",
  "Device Model": "iPhone14,4",
  "App Version": "1.0",
  "Items Purchased": [
    "Hot Dog",
    "Fries",
    "Shake"
  ],
  "SDK Name": "swift",
  "Push Token": "XXX",
  "App Build": "1",
  "$value": 10.99
}

Reproduced the crash by commenting the line where the size is assigned -
image

@ajaysubra ajaysubra requested a review from a team as a code owner January 2, 2024 16:07
@ajaysubra ajaysubra requested a review from kennyklaviyo January 2, 2024 16:07
@ajaysubra ajaysubra changed the title Checking size Fixing a user reported crash on device model code Jan 2, 2024
@evan-masseau
Copy link
Contributor

did the iphone 13 mini repro the crash?

Copy link
Contributor

@evan-masseau evan-masseau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks right. Obvs it'd be great if we could repro the crash too, but IDK if that's possible.

@ajaysubra
Copy link
Contributor Author

did the iphone 13 mini repro the crash?

Yes.

image

@ajaysubra ajaysubra merged commit 8614668 into master Jan 3, 2024
4 checks passed
@ajaysubra ajaysubra deleted the as/BUGPORT-786-device-model branch January 3, 2024 17:25
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.

4 participants