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

Added realm core version to app login request #5961

Merged
merged 3 commits into from
Oct 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* None.

### Breaking changes
* None.

Expand All @@ -17,7 +17,7 @@
-----------

### Internals
* None.
* Added realm core version to the app login request ([#5959](https://github.com/realm/realm-core/issues/5959))

----------------------------------------------

Expand Down
11 changes: 10 additions & 1 deletion src/realm/object-store/sync/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,13 @@ void App::attach_auth_options(BsonDocument& body)
options["appVersion"] = *m_config.local_app_version;
}

log("App: version info: platform: %1 version: %1 - sdk version: %3 - core version: %4", m_config.platform,
m_config.platform_version, m_config.sdk_version, REALM_VERSION_STRING);
options["appId"] = m_config.app_id;
options["platform"] = m_config.platform;
options["platformVersion"] = m_config.platform_version;
options["sdkVersion"] = m_config.sdk_version;
options["coreVersion"] = REALM_VERSION_STRING;

body["options"] = BsonDocument({{"device", options}});
}
Expand All @@ -564,7 +567,13 @@ void App::log_in_with_credentials(
const AppCredentials& credentials, const std::shared_ptr<SyncUser>& linking_user,
UniqueFunction<void(const std::shared_ptr<SyncUser>&, Optional<AppError>)>&& completion)
{
log("App: log_in_with_credentials");
if (would_log()) {
auto app_info = util::format("app_id: %1", m_config.app_id);
if (m_config.local_app_version) {
app_info += util::format(" - app_version: %1", *m_config.local_app_version);
}
log("App: log_in_with_credentials: %1", app_info);
}
// if we try logging in with an anonymous user while there
// is already an anonymous session active, reuse it
if (credentials.provider() == AuthProvider::ANONYMOUS) {
Expand Down
3 changes: 2 additions & 1 deletion test/object-store/sync/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3206,7 +3206,8 @@ class UnitTestTransport : public GenericNetworkTransport {
{"appVersion", "A Local App Version"},
{"platform", "Object Store Test Platform"},
{"platformVersion", "Object Store Test Platform Version"},
{"sdkVersion", "SDK Version"}}}}));
{"sdkVersion", "SDK Version"},
{"coreVersion", REALM_VERSION_STRING}}}}));

CHECK(request.timeout_ms == 60000);

Expand Down