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

Segment Crash issue! #1031

Open
FoxCooper opened this issue Apr 11, 2022 · 2 comments
Open

Segment Crash issue! #1031

FoxCooper opened this issue Apr 11, 2022 · 2 comments

Comments

@FoxCooper
Copy link

Receiving the following crash from some users. The cause of this crash remains unclear, since it’s occurring within the Segment Library. App is running on latest iOS, application written in latest Swift, Cocoa-pods Analytics library install on 4.1.3.

Segment
-[SEGFileStorage dataFromJSON:] at SEGFileStorage.m:232
Segment
-[SEGFileStorage setJSON:forKey:] at SEGFileStorage.m:221
Segment
-[SEGSegmentIntegration persistQueue] SEGSegmentIntegration.m:475
Segment
-[SEGSegmentIntegration sendData:]_block_invoke_2 at SEGSegmentIntegration.m:405
Segment
_seg_dispatch_specific_block_invoke at SEGUtils.m:494
dispatch_block_t autoreleasing_block
@mickyzinho
Copy link

We have the same issue, is there any progress on this?

@thynguyen248
Copy link

In my case, it's due to some unexpected NaN values in my tracking data. So I ended up creating the below extension for dictionary

extension Dictionary where Key == String, Value == Any {
    func removeInvalidValues() -> [String : Any]? {
        return filter { (_, value) in
            if let numberValue = value as? NSNumber {
                return !numberValue.floatValue.isNaN
            }
            return !(value is NSNull)
        }
    }
}

Usage:

var properties: [String: Any] = myTrackingData
Analytics.shared().track(event, properties: properties.removeInvalidValues())

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

No branches or pull requests

3 participants