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

Identify userId is optional but the implementation does not reflect this #1024

Open
danielgomezrico opened this issue Dec 17, 2021 · 5 comments · May be fixed by #1025
Open

Identify userId is optional but the implementation does not reflect this #1024

danielgomezrico opened this issue Dec 17, 2021 · 5 comments · May be fixed by #1025

Comments

@danielgomezrico
Copy link

danielgomezrico commented Dec 17, 2021

This validation does not work if the userId is null:
https://github.com/segmentio/analytics-ios/blob/master/Segment/Classes/SEGAnalytics.m#L272

But here it is checked: https://github.com/segmentio/analytics-ios/blob/master/Segment/Classes/SEGAnalytics.m#L293

It is defined as optional on https://segment.com/docs/connections/sources/catalog/libraries/mobile/ios/#identify
image

I found this because the flutter implementation of segment (claimsforce-gmbh/flutter-segment#59) allowed userId to be null, but it throws this error:

-[NSNull length]: unrecognized selector sent to instance 0x1db450558
@danielgomezrico danielgomezrico changed the title userId is optional but the implementation does not reflect this Identify userId is optional but the implementation does not reflect this Dec 17, 2021
@HerrNiklasRaab
Copy link

Any updates here? Have you had success passing an empty string? Why have you closed that PR on the flutter_segment repo?

@danielgomezrico
Copy link
Author

@HerrNiklasRaab It was closed because that repo became deprecated, now that library works in https://github.com/la-haus/flutter-segment.

The issue is still there, but from the library we send an empty string to it, it does not seem like the best way to do it :(

@HerrNiklasRaab
Copy link

HerrNiklasRaab commented Mar 1, 2022 via email

@danielgomezrico
Copy link
Author

I haven't found drawbacks, but if you find them, let me know

@zenled
Copy link

zenled commented May 12, 2022

Hey, I stumbled upon the same issue when using flutter-segment.
The cause of this issue is not in this library but in the flutter-segment library.
Here is a fix: la-haus/flutter-segment#28

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 a pull request may close this issue.

3 participants