From 9df98cc25793b0bc9a1292ee4b941102a1e87654 Mon Sep 17 00:00:00 2001 From: Michael Wilkerson-Barker Date: Thu, 20 Oct 2022 17:16:41 -0400 Subject: [PATCH 1/3] Added core version to app login request --- src/realm/object-store/sync/app.cpp | 11 ++++++++++- test/object-store/sync/app.cpp | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/realm/object-store/sync/app.cpp b/src/realm/object-store/sync/app.cpp index 484c5e1188d..90e7700e077 100644 --- a/src/realm/object-store/sync/app.cpp +++ b/src/realm/object-store/sync/app.cpp @@ -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}}); } @@ -564,7 +567,13 @@ void App::log_in_with_credentials( const AppCredentials& credentials, const std::shared_ptr& linking_user, UniqueFunction&, Optional)>&& 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) { diff --git a/test/object-store/sync/app.cpp b/test/object-store/sync/app.cpp index 5d702822622..4d22e547729 100644 --- a/test/object-store/sync/app.cpp +++ b/test/object-store/sync/app.cpp @@ -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); From 5d98957e28bac736638f4bd0ca6b44224b91f5cc Mon Sep 17 00:00:00 2001 From: Michael Wilkerson-Barker Date: Thu, 20 Oct 2022 17:25:02 -0400 Subject: [PATCH 2/3] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e572e96618..0a9a13197e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,7 @@ * StringData and Timestamp are now constexpr-constructible. * Remove `set_backlink_class_prefix()` and just always use the `class_` prefix when parsing or serializing queries. * Updated `install_baas.sh` to use files stored on s3 ([#5932](https://github.com/realm/realm-core/issues/5932)) +* Added realm core version to the app login request ([#5959](https://github.com/realm/realm-core/issues/5959)) ---------------------------------------------- From 05a2d772b7cffa018894f917ab88b18e511da763 Mon Sep 17 00:00:00 2001 From: Michael Wilkerson-Barker Date: Fri, 21 Oct 2022 15:10:56 -0400 Subject: [PATCH 3/3] Updated changelog after pulling in master --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a9a13197e2..71659e4a08e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ ### Fixed * ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?) * None. - + ### Breaking changes * None. @@ -17,7 +17,7 @@ ----------- ### Internals -* None. +* Added realm core version to the app login request ([#5959](https://github.com/realm/realm-core/issues/5959)) ---------------------------------------------- @@ -48,7 +48,6 @@ * StringData and Timestamp are now constexpr-constructible. * Remove `set_backlink_class_prefix()` and just always use the `class_` prefix when parsing or serializing queries. * Updated `install_baas.sh` to use files stored on s3 ([#5932](https://github.com/realm/realm-core/issues/5932)) -* Added realm core version to the app login request ([#5959](https://github.com/realm/realm-core/issues/5959)) ----------------------------------------------