Releases: realm/realm-core
Releases · realm/realm-core
Realm Core v14.0.0
Enhancements
- Property keypath in RQL can be substituted with value given as argument. Use '$P' in query string. (Issue #7033)
- You can now use query substitution for the
@type
argument (#7289)
Fixed
- Fixed crash when adding a collection to an indexed Mixed property (#7246, since 14.0.0-beta.0)
- [C-API] Fixed the return type of
realm_set_list
andrealm_set_dictionary
to be the newly inserted collection, similarly to the behavior oflist/dictionary_insert_collection
(PR #7247, since 14.0.0-beta.0) - Throw an exception when trying to insert an embedded object into a list of Mixed (#7254, since 14.0.0-beta.0)
- Queries on dictionaries in Mixed with
@keys
did not return correct result (#7255, since 14.0.0-beta.0) - Changes to inner collections will not be reported by notifier on owning collection (#7270, since 14.0.0-beta.0)
@count
/@size
not supported for mixed properties (#7280, since v10.0.0)- Query with
@type
does not support filtering on collections (#7281, since 14.0.0-beta.0) - Query involving string operations on nested collections would not work (#7282, since 14.0.0-beta.0)
- Using ANY, ALL or NONE in a query on nested collections would throw an exception (#7283, since 14.0.0-beta.0)
- Results notifications does not report changes to inner collections (#7335, since 14.0.0-beta.0)
Breaking changes
- If you want to query using
@type
operation, you must use 'objectlink' to match links to objects. 'object' is reserved for dictionary types.
Compatibility
- Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10 and onwards. If you want to upgrade from an earlier file format version you will have to use RealmCore v13.x.y or earlier.
Internals
- to_json API changed according to https://docs.google.com/document/d/1YtJN0sC89LMb4UVcPKFIfwC0Hsi9Vj7sIEP2vHQzVcY/edit?usp=sharing. Links to not embedded objects will never be followed.
14.0.0-beta.0 Release notes
Enhancements
- Storage of Decimal128 properties has been optimised so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. (PR [#6111]#6111))
- You can have a collection embedded in any Mixed property (except Set).
- Querying a specific entry in a collection (in particular 'first and 'last') is supported. (PR #4269)
- Index on list of strings property now supported (PR #7142)
- You can set the threshold levels for trace output on individual categories. (PR #7004)
Fixed
- Align dictionaries to Lists and Sets when they get cleared. (#6205, since v10.4.0)
- Fixed equality queries on a Mixed property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. (6407 since v11.0.0-beta.5).
- If you have more than 8388606 links pointing to one specific object, the program will crash. (#6577, since v6.0.0)
- Query for NULL value in Dictionary would give wrong results ([6748])(#6748), since v10.0.0)
- A Realm generated on a non-apple ARM 64 device and copied to another platform (and vice-versa) were non-portable due to a sorting order difference. This impacts strings or binaries that have their first difference at a non-ascii character. These items may not be found in a set, or in an indexed column if the strings had a long common prefix (> 200 characters). (PR # 6670, since 2.0.0-rc7 for indexes, and since since the introduction of sets in v10.2.0)
Breaking changes
- Support for upgrading from Realm files produced by RealmCore v5.23.9 or earlier is no longer supported.
- Remove
set_string_compare_method
, only one sort method is now supported which was previously calledSTRING_COMPARE_CORE
. - BinaryData and StringData are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a Mixed property, as now only strings will be returned. If searching for BinaryData is desired, then that type must be specified by the constant. In RQL the new way to specify a binary constant is to use
mixed = bin('xyz')
ormixed = binary('xyz')
. (6407). - In the C API,
realm_collection_changes_get_num_changes
andrealm_dictionary_get_changes
have got an extra parameter to receive information on the deletion of the entire collection. - Sorting order of strings has changed to use standard unicode codepoint order instead of grouping similar english letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". (2573)
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
- Refactoring of the StringIndex interface.
Realm Core v13.27.0
Enhancements
- Add support in the C API for receiving a notification when sync user state changes. (#7302)
- Allow the query builder to construct >, >=, <, <= queries for string constants. This is a case sensitive lexicographical comparison. Improved performance of RQL (parsed) queries on a non-linked string property using: >, >=, <, <=, operators and fixed behaviour that a null string should be evaulated as less than everything, previously nulls were not matched. (#3939, this is a prerequisite for realm/realm-swift#8008).
- Updated bundled OpenSSL version to 3.2.0 (PR #7303)
- Added
SyncSession::get_file_ident()
so you can trigger a client reset via the BAAS admin API (PR #7203). - Audit event scopes containing zero events to save no longer open the audit realm unneccesarily (PR #7332).
- Added a method to check if a file needs upgrade. (#7140)
- Use
clonefile()
when possible inFile::copy()
on Apple platforms for faster copying. (PR #7341).
Fixed
- Fixed queries like
indexed_property == NONE {x}
which mistakenly matched on only x instead of not x. This only applies when an indexed property with equality (==, or IN) matches withNONE
on a list of one item. If the constant list contained more than one value then it was working correctly. (realm-js #7862, since v12.5.0) - Uploading the changesets recovered during an automatic client reset recovery may lead to 'Bad server version' errors and a new client reset. (#7279, since v13.24.1)
- Fixed invalid data in error reason string when registering a subscription change notification after the subscription has already failed. (#6839, since v11.8.0)
- Fixed crash in fulltext index using prefix search with no matches (#7309, since v13.18.0)
- Fix compilation and some warnings when building with Xcode 15.3 (PR #7297).
- util::make_dir_recursive() attempted to create a directory named "\0" if the path did not have a trailing slash (PR #7329).
- Fixed a crash with
Assertion failed: m_initiated
during sync session startup (#7074, since v10.0.0). - Fixed a TSAN violation where the user thread could race to read
m_finalized
with the sync event loop (#6844, since v13.15.1) - Fix a minor race condition when backing up Realm files before a client reset which could have lead to overwriting an existing file. (PR #7341).
Breaking changes
- SyncManager no longer supports reconfiguring after calling reset_for_testing(). SyncManager::configure() has been folded into the constructor, and reset_for_testing() has been renamed to tear_down_for_testing(). (PR #7351)
Compatibility
- Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Internals
- Expressions in
CHECK()
macros are printed to better; strings are quoted and null strings are printed as NULL instead of no output. - Refactored version resolution for the
build-apple-device.sh
script. (#7263) - Remove SyncUser::binding_context() and related things, which were not actually used by any SDKs.
- (bindgen) Upgrade
eslint-config-prettier
&eslint-plugin-prettier
and add a missing peer dependency onprettier
. - The minimum CMake version has changed from 3.15 to 3.22.1. (#6537)
- Update Catch2 to v3.5.2 (PR #7297).
- The unused
partition
anduser_local_uuid()
fields have been removed fromFileActionMetadata
. (PR #7341).
Realm Core v13.26.0
Enhancements
- Added change_base_url() function to update the App base URL at runtime. (PR #7173)
- Sync Client should use the base_url value provided in App::Config instead of always using stored info after first connection to server. (#7201)
Fixed
- Handle
EOPNOTSUPP
when usingposix_fallocate()
and fallback to manually consume space. This should enable android users to open a Realm on restrictive filesystems. (realm-js #6349, more prevalent since v13.23.3 with the change toREALM_HAVE_POSIX_FALLOCATE
but it was also an issue in some platforms before this) - Application may crash with
incoming_changesets.size() != 0
when a download message is mistaken for a bootstrap message. This can happen if the synchronization session is paused and resumed at a specific time. (PR #7238, since v11.8.0) - Fixed errors complaining about missing symbols such as
__atomic_is_lock_free
on ARMv7 Linux. (PR #7257)
Breaking changes
App::get_uncached_app(...)
andApp::get_shared_app(...)
have been replaced byApp::get_app(App::CacheMode, ...)
. The App constructor is now enforced to be unusable, useApp::get_app()
instead. (#7237)- The schema version field in the Realm config had no use for the flexible sync Realms previously. It is now being used for the upcoming Sync Schema Migrations feature. If it was set to a value other than zero, the application will start receiving an error from the server. Data synchronization will be stopped until the Realm is opened with schema version zero. (PR #7239)
Compatibility
- Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Internals
- Add support for chunked transfer encoding when using
HTTPParser
. - Bump the sync protocol to v11. The new protocol version comes with the following changes:
- JSON_ERROR server message contains the previous schema version
- Flexible sync BIND client message contains the current schema version
- Add BAAS admin API to create new schema versions (drafts can be used to deploy all changes at once)
Realm Core v13.25.1
Fixed
- Bad performance of initial Sync download involving many backlinks (#7217, since v10.0.0)
Compatibility
- Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Realm Core v13.25.0
Enhancements
- Exceptions thrown during bootstrap application will now be surfaced to the user via the sync error handler rather than terminating the program with an unhandled exception. (PR #7197).
Fixed
- Exceptions thrown during bootstrap application could crash the sync client with an
!m_sess
assertion if the bootstrap was being applied during sync::Session activation. (#7196, since v12.0.0). - If a SyncSession was explicitly resumed via
handle_reconnect()
while it was waiting to auto-resume after a non-fatal error and then another non-fatal error was received, the sync client could crash with a!m_try_again_activation_timer
assertion. (#6961, since always)
Compatibility
- Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Internals
- Dangling links in a Mixed property will now appear as NULL (#6980)
Realm Core v13.24.1
Enhancements
- Automatic client reset recovery now preserves the original division of changesets, rather than combining all unsynchronized changes into a single changeset (PR #7161).
- Automatic client reset recovery now does a better job of recovering changes when changesets were downloaded from the server after the unuploaded local changes were committed. If the local Realm happened to be fully up to date with the server prior to the client reset, automatic recovery should now always produce exactly the same state as if no client reset was involved (PR #7161).
- [C API] Exposed
realm_app_create_cached
andrealm_app_get_cached
in the C API. (Issue #7181)
Fixed
- Fixed several causes of "decryption failed" exceptions that could happen when opening multiple encrypted Realm files in the same process while using Apple/linux and storing the Realms on an exFAT file system. (#7156, since the beginning)
- Fixed deadlock which occurred when accessing the current user from the
App
from within a callback from theUser
listener (#7183, since v13.21.0) - Update existing std exceptions thrown by the Sync Client to use Realm exceptions. (#6255, since v10.2.0)
- Having a class name of length 57 would make client reset crash as a limit of 56 was wrongly enforced (57 is the correct limit) (#7176, since v10.0.0)
- Automatic client reset recovery on flexible sync Realms would apply recovered changes in multiple write transactions, releasing the write lock in between. This had several observable negative effects:
- Other threads reading from the Realm while a client reset was in progress could observe invalid mid-reset state.
- Other threads could potentially write in the middle of a client reset, resulting in history diverging from the server.
- The change notifications produced by client resets were not minimal and would report that some things changed which actually didn't.
- All pending subscriptions were marked as Superseded and then recreating, resulting in anything waiting for subscriptions to complete firing early.
(PR #7161, since v12.3.0).
- If the very first open of a flexible sync Realm triggered a client reset, the configuration had an initial subscriptions callback, both before and after reset callbacks, and the initial subscription callback began a read transaction without ending it (which is normally going to be the case), opening the frozen Realm for the after reset callback would trigger a BadVersion exception (PR #7161, since v12.3.0).
- Changesets have wrong timestamps if the local clock lags behind 2015-01-01T00:00:00Z. The sync client now throws an exception if that happens. (PR #7180)
- Allow propagation of user code exceptions happening during client reset callbacks, retrievable via
realm_sync_error_t
inrealm_sync_config_set_error_handler
in the C-API. (#7098, since v11.16.0)
Breaking changes
- Update existing std exceptions thrown by the Sync Client to use Realm exceptions. (PR #7141)
Compatibility
- Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Internals
Realm Core v14.0.0-beta.0
Enhancements
- Storage of Decimal128 properties has been optimised so that the individual values will take up 0 bits (if all nulls), 32 bits, 64 bits or 128 bits depending on what is needed. (PR [#6111]#6111))
- You can have a collection embedded in any Mixed property (except Set).
- Querying a specific entry in a collection (in particular 'first and 'last') is supported. (PR #4269)
- Index on list of strings property now supported (PR #7142)
- You can set the threshold levels for trace output on individual categories. (PR #7004)
Fixed
- Align dictionaries to Lists and Sets when they get cleared. (#6205, since v10.4.0)
- Fixed equality queries on a Mixed property with an index possibly returning the wrong result if values of different types happened to have the same StringIndex hash. (6407 since v11.0.0-beta.5).
- If you have more than 8388606 links pointing to one specific object, the program will crash. (#6577, since v6.0.0)
- Query for NULL value in Dictionary would give wrong results ([6748])(#6748), since v10.0.0)
- A Realm generated on a non-apple ARM 64 device and copied to another platform (and vice-versa) were non-portable due to a sorting order difference. This impacts strings or binaries that have their first difference at a non-ascii character. These items may not be found in a set, or in an indexed column if the strings had a long common prefix (> 200 characters). (PR # 6670, since 2.0.0-rc7 for indexes, and since since the introduction of sets in v10.2.0)
Breaking changes
- Support for upgrading from Realm files produced by RealmCore v5.23.9 or earlier is no longer supported.
- Remove
set_string_compare_method
, only one sort method is now supported which was previously calledSTRING_COMPARE_CORE
. - BinaryData and StringData are now strongly typed for comparisons and queries. This change is especially relevant when querying for a string constant on a Mixed property, as now only strings will be returned. If searching for BinaryData is desired, then that type must be specified by the constant. In RQL the new way to specify a binary constant is to use
mixed = bin('xyz')
ormixed = binary('xyz')
. (6407). - In the C API,
realm_collection_changes_get_num_changes
andrealm_dictionary_get_changes
have got an extra parameter to receive information on the deletion of the entire collection. - Sorting order of strings has changed to use standard unicode codepoint order instead of grouping similar english letters together. A noticeable change will be from "aAbBzZ" to "ABZabz". (2573)
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
- Refactoring of the StringIndex interface.
Realm Core v13.24.0
Enhancements
- Refactored how KeyPathArrays are created in the C-API by adding
realm_create_key_path_array
which allows a SDK to pass in the string representation of the keypath and then let Core calculate the correct TableKey/ColKey pairs instead of doing this on the SDK side. (PR #7087) - KeyPathArrays can be constructed with a wildcard notation. (Issue #7125)
Fixed
Set::assign_intersection()
onSet<StringData>
,Set<BinaryData>
, andSet<Mixed>
containing string or binary would cause a use-after-free if a set was intersected with itself (PR #7144, since v10.0.0).- Set algebra on
Set<StringData>
andSet<BinaryData>
gave incorrect results when used on platforms wherechar
is signed (#7135, since v13.23.3). - Errors encountered while reapplying local changes for client reset recovery on partition-based sync Realms would result in the client reset attempt not being recorded, possibly resulting in an endless loop of attempting and failing to automatically recover the client reset. Flexible sync and errors from the server after completing the local recovery were handled correctly (PR #7149, since v10.2.0).
- During a client reset with recovery when recovering a move or set operation on a
LnkLst
orLst<Mixed>
that operated on indices that were not also added in the recovery, links to an object which had been deleted by another client while offline would be recreated by the recovering client. But the objects of these links would only have the primary key populated and all other fields would be default values. Now, instead of creating these zombie objects, the lists being recovered skip such deleted links. (#7112 since the beginning of client reset with recovery in v11.16.0) - During a client reset recovery a Set of links could be missing items, or an exception could be thrown that prevents recovery ex: "Requested index 1 calling get() on set 'source.collection' when max is 0" (#7112, since the beginning of client reset with recovery in v11.16.0)
- Calling
sort()
ordistinct()
on aLnkSet
that had unresolved links in it would produce duplicate indices. - Some fields in
realm_error_t
were uninitialized and contained invalid values when being converted from sync errors - now they should properly be nullptr (PR #7154, since v13.18.0) - Automatic client reset recovery would duplicate insertions in a list when recovering a write which made an unrecoverable change to a list (i.e. modifying or deleting a pre-existing entry), followed by a subscription change, followed by a write which added an entry to the list (PR #7155, since v12.3.0).
Breaking changes
- None.
Compatibility
- Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Internals
- None.
RealmCore v13.23.4
Enhancements
- None.
Fixed
- A crash at a very specific time during a DiscardLocal client reset on a FLX Realm could leave subscriptions in an invalid state (#7110, since v12.3.0).
- Fixed an error "Invalid schema change (UPLOAD): cannot process AddColumn instruction for non-existent table" when using automatic client reset with recovery in dev mode to recover schema changes made locally while offline. (#7042 since the server introduced the feature that allows client to redefine the server's schema if the server is in dev mode - fall 2023)
- Fix missing symbol linker error for
Set<ObjKey>
when building with Clang and LTO enabled (#7121, since v12.23.3).
Breaking changes
- None.
Compatibility
- Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Internals
Realm Core v13.23.3
Enhancements
- Cancel asynchronous notifications on subscription state change in case of fatal session errors and when the session becomes inactive. (PR #7073)
Fixed
- A new design around using a scheduler in C API has enabled the proper release of the user data (See "Breaking Changes") (#7094, since v10.4.0)
- Potential stack-use-after-scope issue on changesets integration with msvc-2019 and mpack code (PR #6911)
- Fix compilation with non-beta Xcode 15. Building for visionOS now requires explicitly specifying
-DCMAKE_XCODE_ATTRIBUTE_SDKROOT=xros
(PR #7055). - Fixed FLX subscriptions not being sent to the server if the session was interrupted during bootstrapping. (#7077, since v11.8.0)
- Fixed FLX subscriptions not being sent to the server if an upload message was sent immediately after a subscription was committed but before the sync client checks for new subscriptions via
SubscriptionStore::get_next_pending_version()
. (#7076, since v13.23.1) - Fixed application crash with 'KeyNotFound' exception when subscriptions are marked complete after a client reset. (#7090, since v12.3.0)
Breaking changes
- In the C API, the callback function realm_scheduler_notify_func_t now has a second parameter pointing to a work_queue. This pointer has to be kept until the notifications can be run on the proper thread. Then it has to be passed on to realm_scheduler_perform_work. The value returned from realm_scheduler_new (and friends) should be released after it has been used in realm_config_set_scheduler.
Compatibility
- Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
Internals
- REALM_[ATMU]SAN cmake flags no longer override compilation options and can be combined with Debug|RelWithDebInfo|etc. build types. Rel[ATMU]SAN build type shortcuts are now all slightly optimized debug-based builds with sanitizers. REALM_ASAN now works with msvc (2019/2022) builds. (PR #6911)
- Add support for building against the musl library. (PR #7067)
- Remove ArrayWithFind's ability to use a templated callback parameter. The QueryStateBase consumers now use an index and the array leaf to get the actual value if needed. This allows certain queries such as count() to not do as many lookups to the actual values and results in a small performance gain. Also remove
find_action_pattern()
which was unused for a long time. This reduction in templating throughout the query system produces a small (~100k) binary size reduction. (#7095) - Rework the implemenatation of the set algrebra functions on Set to reduce the compiled size.
- Rework the internal interface for sync Transformers to simplify it and reduce the compiled size (PR #7098).