Skip to content

Commit

Permalink
Merge branch 'master' into feature/exception-unification
Browse files Browse the repository at this point in the history
  • Loading branch information
jedelbo committed Sep 15, 2022
2 parents 8b715e8 + b985738 commit 87acb34
Show file tree
Hide file tree
Showing 180 changed files with 6,113 additions and 5,721 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ CTestTestfile.cmake
Makefile
Realm.xcodeproj
CMakeScripts

# Ignore build artifacts
/build*
/debug*

# Ignore all user files except one which includes execution path for test
*.user
Expand Down Expand Up @@ -54,6 +57,10 @@ compile_commands.json
# ref doc
/doc/ref_cpp/html/*

# cpack artifacts
/_CPack_Packages*
/realm-*.tar.gz

# sh build.sh build-cocoa
/core-*.zip
/macosx-lib/
Expand Down
103 changes: 98 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,111 @@

### Enhancements
* <New feature description> (PR [#????](https://github.com/realm/realm-core/pull/????))
* Convert object_store::Collection types into Results (PR [#5845](https://github.com/realm/realm-core/pull/5845))

### Fixed
* <How do the end-user experience this issue? what was the impact?> ([#????](https://github.com/realm/realm-core/issues/????), since v?.?.?)
* Fix a data race on RealmCoordinator::m_sync_session which could occur if multiple threads performed the initial open of a Realm at once. (since v11.8.0).
* If a SyncSession outlived the parent Realm and then was adopted by a new Realm for the same file, other processes would not get notified for sync writes on that file.
* Fix one cause of QoS inversion warnings when performing writes on the main thread on Apple platforms. Waiting for async notifications to be ready is now done in a QoS-aware ways.
* `Realm::refresh()` did not actually advance to the latest version in some cases. If there was a version newer than the current version which did not require blocking it would advance to that instead, contrary to the documented behavior.
* Fixed `realm_query_parse_for_results` ignoring query for `query_result_t` passed as parameter ([#5841](https://github.com/realm/realm-core/pull/5841)).
* The C API type `realm_sync_error_code_t` did not include a textural representation of the underlying category. ([#5399](https://github.com/realm/realm-core/issues/5399)),
* Calling Results::sum/min/max on a RealmList field returns its memory address. ([#5137](https://github.com/realm/realm-core/issues/5137))

### Breaking changes
* All exceptions thrown out of Core are now of type 'Exception'. All use of std::runtime_error and std::logical_error etc. has stopped and the specialized error classes that beforehand were based on these are now based on Exception.

### Compatibility
* Fileformat: Generates files with format v22. Reads and automatically upgrade from fileformat v5.

-----------

### Internals
* None.

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

# 12.6.0 Release notes

### Enhancements
* Notify when read transaction version is advanced. ([PR #5704](https://github.com/realm/realm-core/pull/5704)).
* Action returned from the server in the json error messages is surfaced through the SyncError. ([PR #5690](https://github.com/realm/realm-core/pull/5690)).
* `NotificationToken` grew an `unregister()` method as an alternative to destroying it or doing `token = {};` ([PR #5776](https://github.com/realm/realm-core/pull/5776)).
* Automatic handling backlinks for schema migrations where a class changes to being embedded. ([PR #5737](https://github.com/realm/realm-core/pull/5737)).
* Expose `Obj::add_int()` in the CAPI. ([PR #5770](https://github.com/realm/realm-core/pull/5770)).
* Expose `Realm::async_begin_transaction`, `Realm::async_commit_transaction`, `Realm::async_cancel_transaction` in the CAPI.([PR 5783 #](https://github.com/realm/realm-core/pull/5783)).
* Added `Obj::get_parent_object()` that will allow you to get the parent object of an embedded object ([#3898](https://github.com/realm/realm-core/issues/3898))
* Improve performance when a new Realm file connects to the server for the first time, especially when significant amounts of data has been written while offline.
* Shift more of the work done on the sync worker thread out of the write transaction used to apply server changes, reducing how long it blocks other threads from writing.
* Improve the performance of the sync changeset parser, which speeds up applying changesets from the server.
* Sync client sends integration errors to the server. ([PR #5719](https://github.com/realm/realm-core/pull/5719)).

### Fixed
* Fixed undefined behaviour on queries involving a constant and an indexed column on some property types like UUID and Timestamp. ([#5753](https://github.com/realm/realm-core/issues/5753), since 12.5.0)
* Fix all UBSan failures hit by tests. It is unclear if any of these manifested as visible bugs. ([PR #5665](https://github.com/realm/realm-core/pull/5665))
* Fix sorting order for `realm_query_find_first` in the C API.([#5720](https://github.com/realm/realm-core/issues/5720))
* Upload completion callbacks may have called before the download message that completed them was fully integrated. ([#4865](https://github.com/realm/realm-core/issues/4865)).
* Fixed an exception "fcntl() with F_BARRIERFSYNC failed: Inappropriate ioctl for device" when running with MacOS on an exFAT drive. ([#5789](https://github.com/realm/realm-core/issues/5789) since 12.0.0)
* Syncing of a Decimal128 with big significand could result in a crash. ([#5728](https://github.com/realm/realm-core/issues/5728))
* Recovery/discardLocal client reset modes will now wait for FLX sync realms to be fully synchronized before beginning recovery operations ([#5705](https://github.com/realm/realm-core/issues/5705))

### Breaking changes
* None.

### Compatibility
* Fileformat: Generates files with format v22. Reads and automatically upgrade from fileformat v5.

-----------

### Internals
* `util::Any` is now just a typedef for `std::any`. `util::any_cast()` remains for deployment support on older Apple platforms. Outside of niche ADL implications, this should not have any visible effects. ([PR #5665](https://github.com/realm/realm-core/pull/5665))
* Use correct endpoints for checking if sync has been terminated in client reset tests ([#5815](https://github.com/realm/realm-core/pull/5815))
* The sync protocol is now version 7.

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

# 12.5.1 Release notes

### Enhancements
* None.

### Fixed
* Fixed an issue where having realm-cocoa as SPM sub-target dependency leads to missing symbols error during iOS archiving. ([#7645](https://github.com/realm/realm-swift/issues/7645))
* Exposed the boolean `merge_with_existing` in the C-API's functions `realm_convert_with_config` and `realm_convert_with_path`. ([#5713](https://github.com/realm/realm-core/issues/5713))
* Processing a pending bootstrap before the sync client connects will properly surface errors to the user's error handler ([#5707](https://github.com/realm/realm-core/issues/5707), since v12.0.0)
* Opening a read-only Realm for the first time via `Realm::get_synchronized_realm()` would remove any columns present on the server but not in the local schema (since 12.5.0).
* Parsing a constant list of strings from RealmJS SDK to QueryParser would result in a "use after free situation". ([#5735](https://github.com/realm/realm-core/issues/5735))

### Breaking changes
* Notification callbacks no longer take an `exception_ptr` argument because errors haven't been possible for a few years. (PR [#5741](https://github.com/realm/realm-core/pull/5741))

### Compatibility
* Fileformat: Generates files with format v22. Reads and automatically upgrade from fileformat v5.

-----------

### Internals
* The top function of an assertion stack trace now includes the core version number.
* Unset SDKROOT env variable when building ios targets with tools/build-apple-device.sh

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

# 12.5.0 Release notes

### Enhancements
* Allow multiple anonymous sessions. ([PR #5693](https://github.com/realm/realm-core/pull/5693)).
* Introducing query parser support for constant list expressions such as `fruit IN {'apple', 'orange'}`. This also includes general query support for list vs list matching such as `NONE fruits IN {'apple', 'orange'}`. ([Issue #4266](https://github.com/realm/realm-core/issues/4266))
* SubscriptionSet::refresh() does less work if no commits have been made since the last call to refresh(). ([PR #5695](https://github.com/realm/realm-core/pull/5695))

### Fixed
* Fix error message when validating outgoing links from asymmetric objects to non-embedded objects. ([PR #5702](https://github.com/realm/realm-core/pull/5702))
* Fix a use-after-free when an AuditContext is destroyed while a different thread is in the completion handler for an audit Realm upload. ([PR #5714](https://github.com/realm/realm-core/pull/5714))
* The C API type `realm_sync_error_code_t` did not include a textural representation of the underlying category. ([#5399](https://github.com/realm/realm-core/issues/5399)),
* Calling Results::sum/min/max on a RealmList field returns its memory address. ([#5137](https://github.com/realm/realm-core/issues/5137))
* Opening a read-only Realm for the first time via `Realm::get_synchronized_realm()` did not set the schema version, which could lead to `m_schema_version != ObjectStore::NotVersioned` assertion failures.
* Using the Query Parser, it was not allowed to query on a property named 'desc'. ([#5723](https://github.com/realm/realm-core/issues/5723))

### Breaking changes
* All exceptions thrown out of Core are now of type 'Exception'. All use of std::runtime_error and std::logical_error etc. has stopped and the specialized error classes that beforehand were based on these are now based on Exception.
* None

### Compatibility
* Fileformat: Generates files with format v22. Reads and automatically upgrade from fileformat v5.
Expand Down Expand Up @@ -80,7 +173,7 @@
* Fix a UBSan failure when mapping encrypted pages.
* Improved performance of sync clients during integration of changesets with many small strings (totalling > 1024 bytes per changeset) on iOS 14, and devices which have restrictive or fragmented memory. ([#5614](https://github.com/realm/realm-core/issues/5614))
* Fixed a bug that prevented the detection of tables being changed to or from asymmetric during migrations. ([#5603](https://github.com/realm/realm-core/pull/5603), since v12.1.0)

### Breaking changes
* In Realm JS, the client reset callback can result in the fatal error `Realm accessed on incorrect thread`. Using a thread safe reference instead of Realm instance fixes the issue. (Issue [realm/realm-js#4410](https://github.com/realm/realm-js/issues/4410))

Expand Down Expand Up @@ -108,7 +201,7 @@
* Fixed a missing backlink removal when setting a Mixed from a TypedLink to null or any other non-link value. Users may have seen exception of "key not found" or assertion failures such as `mixed.hpp:165: [realm-core-12.1.0] Assertion failed: m_type` when removing the destination link object. ([#5574](https://github.com/realm/realm-core/pull/5573), since the introduction of Mixed in v11.0.0)
* Asymmetric sync now works with embedded objects. (Issue [#5565](https://github.com/realm/realm-core/issues/5565), since v12.1.0)
* Fixed an issue on Windows that would cause high CPU usage by the sync client when there are no active sync sessions. (Issue [#5591](https://github.com/realm/realm-core/issues/5591), since the introduction of Sync support for Windows)

### Breaking changes
* `realm_sync_before_client_reset_func_t` and `realm_sync_after_client_reset_func_t` in the C API now return a boolean value to indicate whether the callback succeeded or not, which signals to the sync client that a fatal error occurred. (PR [#5564](https://github.com/realm/realm-core/pull/5564))

Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "^Windows")
elseif(APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(CATCH_CONFIG_NO_POSIX_SIGNALS ON CACHE BOOL "Disable Catch support for POSIX signals on Apple platforms other than macOS")
endif()
set(CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS ON CACHE BOOL "Enable Catch2's optional standard library stringmakers")

add_subdirectory(external/catch EXCLUDE_FROM_ALL)

Expand Down
29 changes: 1 addition & 28 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
TABLE OF CONTENTS

1. Apache License version 2.0
2. Export Compliance

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

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -181,24 +174,4 @@ TABLE OF CONTENTS
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

EXPORT COMPLIANCE

You understand that the Software may contain cryptographic functions that may be
subject to export restrictions, and you represent and warrant that you are not
(i) located in a jurisdiction that is subject to United States economic
sanctions (“Prohibited Jurisdiction”), including Cuba, Iran, North Korea,
Sudan, Syria or the Crimea region, (ii) a person listed on any U.S. government
blacklist (to include the List of Specially Designated Nationals and Blocked
Persons or the Consolidated Sanctions List administered by the U.S. Department
of the Treasury’s Office of Foreign Assets Control, or the Denied Persons List
or Entity List administered by the U.S. Department of Commerce)
(“Sanctioned Person”), or (iii) controlled or 50% or more owned by a Sanctioned
Person.

You agree to comply with all export, re-export and import restrictions and
regulations of the U.S. Department of Commerce or other agency or authority of
the United States or other applicable countries. You also agree not to transfer,
or authorize the transfer of, directly or indirectly, of the Software to any
Prohibited Jurisdiction, or otherwise in violation of any such restrictions or
regulations.

3 changes: 2 additions & 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 = "12.4.0"
let versionStr = "12.6.0"
let versionPieces = versionStr.split(separator: "-")
let versionCompontents = versionPieces[0].split(separator: ".")
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""
Expand Down Expand Up @@ -80,6 +80,7 @@ let notSyncServerSources: [String] = [
"realm/node.cpp",
"realm/obj.cpp",
"realm/obj_list.cpp",
"realm/object_converter.cpp",
"realm/object_id.cpp",
"realm/query.cpp",
"realm/query_engine.cpp",
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ unacceptable behavior to [[email protected]](mailto:community-conduc

## License

Realm Core is published under the Apache 2.0 license.

**This product is not being made available to any person located in Cuba, Iran,
North Korea, Sudan, Syria or the Crimea region, or to any other person that is
not eligible to receive the product under U.S. law.**
Realm Core is published under the Apache 2.0 license.

Please also see THIRD-PARTY-NOTICES for and licenses related to included third party libraries.

Expand Down
4 changes: 2 additions & 2 deletions dependencies.list
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PACKAGE_NAME=realm-core
VERSION=12.4.0
VERSION=12.6.0
OPENSSL_VERSION=1.1.1n
MDBREALM_TEST_SERVER_TAG=2022-07-14
MDBREALM_TEST_SERVER_TAG=2022-09-01
16 changes: 16 additions & 0 deletions doc/protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,20 @@ network connection. The server may need these for statistics purposes. The value
must be a nonnegative integer strictly less than 2^63.


### JSON_ERROR

head = 'json_error' <error_code> <message size> <session ident>
body = <message>

Introduced in protocol version 7.
When the client encounters an error that appears to be caused by the connected server,
it will send an [JSON_ERROR](#json_error) message to the server.

The body of the message will be in JSON format with the following keys currently supported:
- `message` is a detailed description of the error.
The connection to the server is closed immediately after the [JSON_ERROR](#json_error) message is sent.



Server --> client
-----------------
Expand Down Expand Up @@ -991,6 +1005,8 @@ The body of the message will be in JSON format with the following keys currently
- `tryAgain` is boolean indicating the fatality of the error and is identical to the
<try again> field in the ERROR message header.
- `shouldClientReset` is a boolean indicating if the error requires a client reset.
- `action` is a string indicating the action the client should take as result of the
error.
If a client received an [JSON_ERROR](#json_error) message, it must send an [UNBIND](#unbind)
and no other messages back.

Expand Down
Loading

0 comments on commit 87acb34

Please sign in to comment.