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

Documentation for track, screen, and identify regarding properties isn't fully accurate + unexpected debug crash #254

Closed
cprince-foreflight opened this issue Sep 25, 2023 · 2 comments
Assignees
Labels

Comments

@cprince-foreflight
Copy link
Contributor

Describe the bug
The documentation here suggests that any properties passed to track that are Codable will be successfully logged. This isn't fully accurate.

Instead, the properties must be able to be passed to the JSON init method. Further, if that JSON init method throws an error due to type issues with the passed properties, then with debug builds an assert causes a crash.

With our app, I don't want use of Segment to cause a debug crash.

This also is true for screen and identify calls.

To Reproduce
As indicated above.

Expected behavior

  1. I think the docs should better reflect the actual constraints on the property types.
  2. Library users should be given the option about whether they want these debug asserts to cause crashes. E.g., this should be configurable.

Screenshots
N/A

Platform (please complete the following information):

  • Library Version in use: 1.4.7
  • Platform being tested: iOS

Additional context
N/A

@cprince-foreflight
Copy link
Contributor Author

I see now that the type part of my statement above more strongly applies to the untyped signature alternative.

I still believe that the library caller should have control over whether such typing issues cause crashes in debug builds.

@bsneed
Copy link
Contributor

bsneed commented Sep 25, 2023

They will be successfully logged, provided they're expressible in JSON. You're getting the assert in your debug build because the params you're supplying are NOT expressible in JSON. This assert isn't going to be removed, and we're not going to make it an option. It's there for you to know that you need to fix the parameters or stop sending them because they will not show up in Segment.

The docs you reference show conformance to Codable, which seems to be a pretty strong indicator of what the type requirements are.

@bsneed bsneed closed this as completed Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants