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

Release 14.6.0 merge into master #7637

Closed
wants to merge 2 commits into from
Closed
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
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,35 @@

### Enhancements
* <New feature description> (PR [#????](https://github.com/realm/realm-core/pull/????))
* None.

### 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.

### Compatibility
* Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10. If you want to upgrade from an earlier file format version you will have to use RealmCore v13.x.y or earlier.

-----------

### Internals
* None.

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

# 14.6.0 Release notes
Copy link
Collaborator

Choose a reason for hiding this comment

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

should you add the section for next release now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure if it was added as part of this merge or in a separate PR. I can add it now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

don't know either. but at least now we update the changelog for the next release


### Enhancements
* Add `SyncClientConfig::security_access_group` which allows specifying the access group to use for the sync metadata Realm's encryption key. Setting this is required when sharing the metadata Realm between apps on Apple platforms ([#7552](https://github.com/realm/realm-core/pull/7552)).
* When connecting to multiple server apps, a unique encryption key is used for each of the metadata Realms rather than sharing one between them ([#7552](https://github.com/realm/realm-core/pull/7552)).
* Introduce the new `SyncUser` interface which can be implemented by SDKs to use sync without the core App Services implementation (or just for greater control over user behavior in tests). ([PR #7300](https://github.com/realm/realm-core/pull/7300).
* Improve perfomance of "chained OR equality" queries for UUID/ObjectId types and RQL parsed "IN" queries on string/int/uuid/objectid types. ([.Net #3566](https://github.com/realm/realm-dotnet/issues/3566), since the introduction of these types)
* Introducing `Query::in()` which allows SDKs to take advantage of improved performance when building equality conditions against many constants. ([#7582](https://github.com/realm/realm-core/pull/7582))

### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* SyncUser::all_sessions() included sessions in every state *except* for waiting for access token, which was weirdly inconsistent. It now includes all sessions. ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
* App::all_users() included logged out users only if they were logged out while the App instance existed. It now always includes all logged out users. ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
* Deleting the active user left the active user unset rather than selecting another logged-in user as the active user like logging out and removing users did. ([PR #7300](https://github.com/realm/realm-core/pull/7300)).
Expand All @@ -20,6 +41,7 @@
* Non-streaming download sync progress notification is fixed for flexible sync Realms where before it was sometimes stopping to emit values right after the registration of the callback (PR [#7561](https://github.com/realm/realm-core/issues/7561)).
* Schema initialization could hit an assertion failure if the sync client applied a downloaded changeset while the Realm file was in the process of being opened ([#7041](https://github.com/realm/realm-core/issues/7041), since v11.4.0).
* Queries using query paths on Mixed values returns inconsistent results ([#7587](https://github.com/realm/realm-core/issues/7587), since v14.0.0)
* Enabling 'cancel_waits_on_nonfatal_error' does not cancel waits during location update while offline ([#7527](https://github.com/realm/realm-core/issues/7527), since v13.26.0)

### Breaking changes
* The following things have been renamed or moved as part of moving all of the App Services functionality to the app namespace:
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription
import Foundation

let versionStr = "14.5.2"
let versionStr = "14.6.0"
let versionPieces = versionStr.split(separator: "-")
let versionCompontents = versionPieces[0].split(separator: ".")
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""
Expand Down
33 changes: 16 additions & 17 deletions bindgen/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ headers:
- "realm/object-store/sync/app.hpp"
- "realm/object-store/sync/sync_manager.hpp"
- "realm/object-store/sync/sync_session.hpp"
- "realm/object-store/sync/app_user.hpp"
- "realm/object-store/sync/sync_user.hpp"
- "realm/object-store/sync/app_user.hpp"
- "realm/object-store/sync/mongo_collection.hpp"
- "realm/util/bson/bson.hpp"

Expand Down Expand Up @@ -739,6 +739,7 @@ classes:
# TODO: Consider making preverify_ok a bool.
make_ssl_verify_callback: '(callback: (server_address: const std::string&, server_port: int, pem_data: std::string_view, preverify_ok: int, depth: int) off_thread -> bool) -> SSLVerifyCallback'
needs_file_format_upgrade: '(config: const RealmConfig&) -> bool'
sync_user_as_app_user: '(sync_user: Nullable<std::shared_ptr<SyncUser>>) -> Nullable<std::shared_ptr<User>>'

LogCategoryRef:
cppName: util::LogCategoryRef
Expand Down Expand Up @@ -1205,7 +1206,13 @@ classes:
cppName: app::User::Token

SyncUser:
cppName: SyncUser
sharedPtrWrapped: SharedSyncUser

User:
base: SyncUser
cppName: app::User
sharedPtrWrapped: SharedUser
properties:
is_logged_in: bool
user_id: std::string
Expand All @@ -1214,21 +1221,6 @@ classes:
access_token: std::string
refresh_token: std::string
state: SyncUserState
sync_manager: SharedSyncManager
methods:
access_token_refresh_required: '() -> bool'
# request_log_out: '(cb: AsyncCallback<(err: std::optional<AppError>)>&&)'
request_refresh_user: '(cb: AsyncCallback<(err: std::optional<AppError>)>&&)'
request_refresh_location: '(cb: AsyncCallback<(err: std::optional<AppError>)>&&)'
request_access_token: '(cb: AsyncCallback<(err: std::optional<AppError>)>&&)'
track_realm: '(path: std::string_view)'
create_file_action: '(action: SyncFileAction, original_path: std::string_view, requested_recovery_dir: std::optional<std::string>, partition_value: std::string_view) -> std::string'

User:
base: SyncUser
cppName: app::User
sharedPtrWrapped: SharedUser
properties:
is_anonymous: bool
device_id: std::string
has_device_id: bool
Expand All @@ -1242,6 +1234,13 @@ classes:
subscribe: '(observer: (user: IgnoreArgument<const User&>)) -> UserSubscriptionToken'
unsubscribe: '(token: UserSubscriptionToken)'
path_for_realm: '(config: SyncConfig&, custom_file_name: std::optional<std::string>&) -> std::string'
access_token_refresh_required: '() -> bool'
# # request_log_out: '(cb: AsyncCallback<(err: std::optional<AppError>)>&&)'
request_refresh_user: '(cb: AsyncCallback<(err: std::optional<AppError>)>&&)'
request_refresh_location: '(cb: AsyncCallback<(err: std::optional<AppError>)>&&)'
request_access_token: '(cb: AsyncCallback<(err: std::optional<AppError>)>&&)'
track_realm: '(path: std::string_view)'
create_file_action: '(action: SyncFileAction, original_path: std::string_view, requested_recovery_dir: std::optional<std::string>, partition_value: std::string_view) -> std::string'

UserProfile:
cppName: app::UserProfile
Expand Down Expand Up @@ -1361,7 +1360,7 @@ classes:
reconnect: ()
wait_for_sessions_to_terminate: ()
get_existing_active_session: '(path: const std::string&) -> Nullable<SharedSyncSession>'
get_all_sessions_for: '(user: const SyncUser&) -> std::vector<SharedSyncSession>'
get_all_sessions_for: '(user: const User&) -> std::vector<SharedSyncSession>'

ThreadSafeReference: {}
AsyncOpenTask:
Expand Down
7 changes: 7 additions & 0 deletions bindgen/src/realm_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <realm/object-store/shared_realm.hpp>
#include <realm/object-store/sync/generic_network_transport.hpp>
#include <realm/object-store/util/event_loop_dispatcher.hpp>
#include <realm/object-store/sync/app_user.hpp>
#include <realm/object-store/sync/sync_user.hpp>
#include <realm/util/functional.hpp>
#include <string_view>
#include <system_error>
Expand Down Expand Up @@ -283,6 +285,11 @@ struct Helpers {
{
return config.needs_file_format_upgrade();
}

static std::shared_ptr<app::User> sync_user_as_app_user(std::shared_ptr<SyncUser> sync_user)
{
return std::dynamic_pointer_cast<app::User>(sync_user);
}
};

struct ObjectChangeSet {
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME: realm-core
VERSION: 14.5.2
VERSION: 14.6.0
OPENSSL_VERSION: 3.2.0
ZLIB_VERSION: 1.2.13
# https://github.com/10gen/baas/commits
Expand Down
8 changes: 6 additions & 2 deletions src/realm/object-store/sync/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ void App::log_out(const std::shared_ptr<User>& user, SyncUser::State new_state,
return;
}

log_debug("App: log_out(%1)", user->user_id());
auto request =
make_request(HttpMethod::del, url_for_path("/auth/session"), user, RequestTokenType::RefreshToken, "");

Expand Down Expand Up @@ -1284,14 +1285,17 @@ void App::refresh_access_token(const std::shared_ptr<User>& user, bool update_lo
return;
}

log_debug("App: refresh_access_token: email: %1 %2", user->user_profile().email(),
update_location ? "(updating location)" : "");
log_debug("App: refresh_access_token: user_id: %1%2", user->user_id(),
update_location ? " (updating location)" : "");

// If update_location is set, force the location info to be updated before sending the request
do_request(
make_request(HttpMethod::post, url_for_path("/auth/session"), user, RequestTokenType::RefreshToken, ""),
[completion = std::move(completion), self = shared_from_this(), user](auto&&, const Response& response) {
if (auto error = AppUtils::check_for_errors(response)) {
self->log_error("App: refresh_access_token: %1 -> %2 ERROR: %3", user->user_id(),
response.http_status_code, error->what());

return completion(std::move(error));
}

Expand Down
6 changes: 6 additions & 0 deletions src/realm/object-store/sync/sync_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,15 @@ SyncSession::handle_refresh(const std::shared_ptr<SyncSession>& session, bool re
// internal backoff timer which will happen automatically so nothing needs to
// happen here.
util::CheckedUniqueLock lock(session->m_state_mutex);
// If updating access token while opening realm, just become active at this point
// and try to use the current access token.
if (session->m_state == State::WaitingForAccessToken) {
session->become_active();
}
// If `cancel_waits_on_nonfatal_error` is true, then cancel the waiters and pass along the error
else if (session->config(&SyncConfig::cancel_waits_on_nonfatal_error)) {
session->cancel_pending_waits(std::move(lock), error->to_status()); // unlocks the mutex
}
}
}
else {
Expand Down
Loading
Loading