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

Add support for setting the user agent for sync requests #6007

Merged
merged 3 commits into from
Nov 19, 2018
Merged

Conversation

tgoyne
Copy link
Member

@tgoyne tgoyne commented Nov 16, 2018

I couldn't figure out how to write a meaningful test for this as the only actual result is a change in ROS's log output, but I did manually verify that those were updated as expected. An example of the log output with this:

2018-11-16T19:10:36.464Z - info: [sync] Sync Connection[327]: Session[1]: Client info: (path='/testClassRead/__partial/3deca6d376853ed7c14837d89e3194ee/c57d830d4f57760fa30b7ba2d8c1caa2256230af', user='3deca6d376853ed7c14837d89e3194ee', from=[127.0.0.1]:51573, protocol=25) RealmSync/3.13.3 (macOS Darwin 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct 10 20:06:00 PDT 2018; root:xnu-3789.73.24~1/RELEASE_X86_64 x86_64) Realm Swift/3.11.2 -[SwiftPermissionsAPITests testClassRead]

(-[SwiftPermissionsAPITests testClassRead] is the user-set application identifier, which I set to the test name for testing purposes)

Closes #6003.

@tgoyne tgoyne self-assigned this Nov 16, 2018
@tgoyne tgoyne requested a review from cmelchior November 16, 2018 22:01
Copy link

@ironage ironage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kspangsege
Copy link
Contributor

Looks like this does not follow the intended syntax: https://github.com/realm/realm-sync/blob/770e814e7f136950bec9648a0d5c45c1034e9c75/src/realm/sync/client.hpp#L89-L113.

Not critical, just mentioning it.

@tgoyne
Copy link
Member Author

tgoyne commented Nov 16, 2018

How does it differ?

@kspangsege
Copy link
Contributor

How does it differ?

Either leave it alone, or read the syntax rules, or tell me if they are not intelligible.

@cmelchior
Copy link
Contributor

[SwiftPermissionsAPITests testClassRead]

Should have been (SwiftPermissionsAPITests testClassRead) or ([SwiftPermissionsAPITests testClassRead]) according to syntax suggestion in the docs.

Realm/RLMSyncManager.mm Outdated Show resolved Hide resolved
Realm/RLMSyncManager.mm Show resolved Hide resolved
@tgoyne
Copy link
Member Author

tgoyne commented Nov 16, 2018

Should have been (SwiftPermissionsAPITests testClassRead) or ([SwiftPermissionsAPITests testClassRead]) according to syntax suggestion in the docs.

-[SwiftPermissionsAPITests testClassRead] is the name of the application, not additional details.

@regalcinemas
Copy link

regalcinemas commented Nov 17, 2018 via email

@tgoyne tgoyne merged commit 3fe88c2 into master Nov 19, 2018
@tgoyne tgoyne deleted the tg/user-agent branch November 19, 2018 23:27
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for setting a custom User-Agent
5 participants