-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Describe the bug
Xcode autocomplete for Swift expects person.id
, but codebase expects person.ID
. This caused one of our devs to set the Person id with config.person.id =
, but rollbar-apple will never send it. It checks for config.person.ID
in buildRollbarPerson when preparing to send a message.
This means the .ID
getters and setters are basically unusable in Swift. The other initializers and convenience methods still work, and internally set the correct value -- which I think is why this isn't caught in the tests. The docs only list a couple ways to set the Person properties, although I see in the codebase there are many ways to set the Person properties.
To Reproduce
Steps to reproduce the behavior:
-
Go to Xcode
-
Install rollbar-apple as a dependency
-
Create a
RollbarConfig()
, and attempt to autocompleteconfig.person.ID
-
Fails to compile with error:
'ID' has been renamed to 'id'
Expected behavior
I expected .id
to be the correct property, since that's what's listed as the data field key. I also expected the case to be consistent -- setting .ID
externally to set .id
internally was not obvious when debugging.
Screenshots
See above.
Rollbar-Apple SDK version: Tested with at least v2.0.0-alpha33 through 2.0.0-beta.23. (This mistake was made a while ago and we have had no Persons appear in Rollbar for iOS, while Android + backend have been working as expected.)
Calling the SDK from (x-mark all suitable):
[ ] Objective-C
[x] Swift
[ ] Other:
Runtime environment (please complete the following information as applicable):
- Device: Several simulators and devices
- OS: iOS
- OS version: 14.x, 15.x
Additional context
The convenience method on the config
object is not that convenient, since I can't set any of the fields to nil
. However, creating and setting a Person using the Person initializers works well, e.g.:
config.person = RollbarPerson(id: id, email: email)
It would be great to see more details about initializing and setting a Person in the docs. Also, if for some reason the ID/id field is not set (or has been unset), but the email and/or username field is set, then the Person will be ignored. This should be documented as well.
Overall, thanks for a very useful service!!