Skip to content

Commit

Permalink
Upgrading Realm Core to v13.8.0 (#5638)
Browse files Browse the repository at this point in the history
* Upgraded Realm Core to v13.8.0

* Fixed call to OnlyForTesting::handle_error

* Silence logs from core by default

* Update CHANGELOG.md
  • Loading branch information
kraenhansen authored Mar 27, 2023
1 parent 8a620bf commit 2de97e1
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@
### Enhancements
* Added a new error class `CompensatingWriteError` which indicates that one or more object changes have been reverted by the server.
This can happen when the client creates/updates objects that do not match any subscription, or performs writes on an object it didn't have permission to access. ([#5599](https://github.com/realm/realm-js/pull/5599))
* Performance improvement for the following queries ([realm/realm-core#6376](https://github.com/realm/realm-core/issues/6376)):
* Significant (~75%) improvement when counting (`Realm.Results#length`) the number of exact matches (with no other query conditions) on a `string`/`int`/`uuid`/`objectId` property that has an index. This improvement will be especially noticiable if there are a large number of results returned (duplicate values).
* Significant (~99%) improvement when querying for an exact match on a `date` property that has an index.
* Significant (~99%) improvement when querying for a case insensitive match on a `mixed` property that has an index.
* Moderate (~25%) improvement when querying for an exact match on a `bool` property that has an index.
* Small (~5%) improvement when querying for a case insensitive match on a `mixed` property that does not have an index.

### Fixed
* Fixed passing RealmObject instances between shared Realms. ([#5634](https://github.com/realm/realm-js/pull/5634), since v12.0.0-alpha.0)
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
* Fixed a crash when querying a `mixed` property with a string operator (`contains`/`like`/`beginswith`/`endswith`) or with case insensitivity. ([realm/realm-core#6376](https://github.com/realm/realm-core/issues/6376, since v10.5.0)
* Querying for equality of a string on an indexed `mixed` property was returning case insensitive matches. For example querying for `myIndexedMixed == "Foo"` would incorrectly match on values of `"foo"` or `"FOO"`. ([realm/realm-core#6376](https://github.com/realm/realm-core/issues/6376), since v10.5.0)
* Adding an index to a `mixed` property on a non-empty class/objectType would crash with an assertion. ([realm/realm-core#6376](https://github.com/realm/realm-core/issues/6376), since v10.5.0)
* `Realm.App.Sync#pause()` could hold a reference to the database open after shutting down the sync session, preventing users from being able to delete the Realm. ([realm/realm-core#6372](https://github.com/realm/realm-core/issues/6372), since v11.5.0)
* Fixed a bug that may have resulted in `Realm.Results` and `Realm.List` being in different orders on different devices. Moreover, some cases of the error message `Invalid prior_size` may have be fixed too. ([realm/realm-core#6191](https://github.com/realm/realm-core/issues/6191), since v10.15.0)

### Compatibility
* React Native >= v0.71.0
Expand All @@ -18,6 +28,7 @@ This can happen when the client creates/updates objects that do not match any su

### Internal
* Fixed linting issues and running linting on CI.
* Upgraded Realm Core from v13.6.0 to v13.8.0. ([#5638](https://github.com/realm/realm-js/pull/5638))
<!-- * Either mention core version or upgrade -->
<!-- * Using Realm Core vX.Y.Z -->
<!-- * Upgraded Realm Core from vX.Y.Z to vA.B.C -->
Expand Down
10 changes: 10 additions & 0 deletions packages/bindgen/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,16 @@ classes:
get_results_description: '(results: const Results&) -> StringData'
feed_buffer: '(ws: WatchStream&, buffer: BinaryData)'

Logger:
cppName: util::Logger
sharedPtrWrapped: SharedLogger
properties:
get_default_logger: SharedLogger
get_default_level_threshold: LoggerLevel
staticMethods:
set_default_logger: '(logger: SharedLogger)'
set_default_level_threshold: '(level: LoggerLevel)'

ConstTableRef:
needsDeref: true
iterable: Obj
Expand Down
4 changes: 2 additions & 2 deletions packages/bindgen/src/realm_js_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ struct Helpers {
{
std::error_code error_code(code, type == "realm::sync::ProtocolError" ? realm::sync::protocol_error_category()
: realm::sync::client_error_category());
SyncError error{error_code, message, is_fatal};
sync::SessionErrorInfo error{error_code, message, is_fatal};
error.server_requests_action =
code == 211 ? sync::ProtocolErrorInfo::Action::ClientReset : sync::ProtocolErrorInfo::Action::Warning;
SyncSession::OnlyForTesting::handle_error(session, error);
SyncSession::OnlyForTesting::handle_error(session, std::move(error));
}

// This is entirely because ThreadSafeReference is a move-only type, and those are hard to expose to JS.
Expand Down
4 changes: 4 additions & 0 deletions packages/realm/src/binding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
////////////////////////////////////////////////////////////////////////////

import { IndexSet, Int64, ObjKey, Timestamp } from "../generated/ts/native.mjs";
import { binding } from "./internal.js";

/** @internal */
export * from "../generated/ts/native.mjs"; // core types are transitively exported.
Expand Down Expand Up @@ -73,3 +74,6 @@ export function isEmptyObjKey(objKey: ObjKey) {
// This relies on the JS representation of an ObjKey being a bigint
return Int64.equals(objKey as unknown as Int64, -1);
}

// Silence logs from core by default
binding.Logger.setDefaultLevelThreshold(binding.LoggerLevel.Off);
2 changes: 1 addition & 1 deletion vendor/realm-core
Submodule realm-core updated 122 files

0 comments on commit 2de97e1

Please sign in to comment.