klaviyo / klaviyo-swift-sdk

Swift SDK for integrating Klaviyo’s push notifications, event tracking, and user profile management into iOS applications.
https://www.klaviyo.com/mobile-push-marketing
MIT License
12 stars 11 forks source link

Fixing a user reported crash on device model code #129

Closed ajaysubra closed 9 months ago

ajaysubra commented 9 months ago

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

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

evan-masseau commented 9 months ago

did the iphone 13 mini repro the crash?

ajaysubra commented 9 months ago

did the iphone 13 mini repro the crash?

Yes.

image