Skip to content

Commit

Permalink
Merge branch 'next-major' of github.com:realm/realm-core into nc/clie…
Browse files Browse the repository at this point in the history
…nt_reset_tests_nested_collections
  • Loading branch information
nicola-cab committed Sep 25, 2023
2 parents 27769a7 + 9c32d56 commit d1e96be
Show file tree
Hide file tree
Showing 111 changed files with 2,578 additions and 4,011 deletions.
194 changes: 194 additions & 0 deletions Android.bp
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
package {
default_applicable_licenses: [
"external_realm_license",
"external_realm_dep_intel_math_library_license",
"external_realm_dep_mpark_variant_license",
"external_realm_dep_nlohmann_json_license",
"external_realm_dep_s2_license",
],
}

license {
name: "external_realm_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
],
license_text: [
"LICENSE",
],
}

license {
name: "external_realm_dep_intel_math_library_license",
visibility: [":__subpackages__"],
license_kinds: [
"legacy_notice",
],
license_text: [
"src/external/IntelRDFPMathLib20U2/eula.txt",
],
}

license {
name: "external_realm_dep_mpark_variant_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-BSL-1.0",
],
license_text: [
"src/external/mpark/LICENSE.md",
],
}

license {
name: "external_realm_dep_nlohmann_json_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-MIT",
],
license_text: [
"src/external/json/LICENSE.MIT",
],
}

license {
name: "external_realm_dep_s2_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
],
license_text: [
"src/external/s2/LICENSE-2.0.txt",
],
}

cc_object {
name: "IntelRDFPMathLib20U2",
srcs: [
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_compare.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_mul.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_div.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_add.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_fma.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_string.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_2_str_tables.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid64_to_bid128.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_to_int64.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid128_quantize.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_convert_data.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_data.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_decimal_globals.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_from_int.c",
"src/external/IntelRDFPMathLib20U2/LIBRARY/src/bid_round.c",
],
}

cc_object {
name: "s2",
srcs: ["src/external/s2/**/*.cc"],
defaults: [
"realm_consumer_defaults",
"realm_defaults",
],
local_include_dirs: [
"src",
"src/external",
"src/external/s2",
],
cflags: [
"-Wno-deprecated-declarations",
"-Wno-ignored-qualifiers",
"-Wno-macro-redefined",
"-Wno-missing-prototypes",
"-Wno-shorten-64-to-32",
"-Wno-undefined-var-template",
"-Wno-unknown-pragmas",
"-Wno-unused-const-variable",
"-Wno-unused-function",
"-Wno-unused-local-typedefs",
"-Wno-unused-parameter",
],
}

genrule {
name: "version_numbers.hpp",
srcs: [
"dependencies.list",
"src/realm/version_numbers.hpp.in",
],
out: ["realm/version_numbers.hpp"],
tool_files: ["tools/generate-version-numbers-for-soong.sh"],
cmd: "$(location) $(in) > $(out)",
}

cc_defaults {
name: "realm_consumer_defaults",
cpp_std: "c++17",
rtti: true,
cppflags: [
"-fexceptions",
],
debug: {
cflags: ["-DREALM_DEBUG"],
},
shared_libs: [
"liblog",
"libandroid",
"libz",
"libcrypto",
"libssl",
],
}

cc_defaults {
name: "realm_defaults",
cflags: [
"-fPIC",
"-DREALM_NO_CONFIG",
"-DREALM_HAVE_OPENSSL=1",
"-DREALM_ENABLE_ENCRYPTION=1",
"-DREALM_ENABLE_SYNC=1",
"-DREALM_ENABLE_GEOSPATIAL=1",
"-DREALM_HAVE_EPOLL=1",
"-Wno-non-virtual-dtor",
"-Wno-missing-field-initializers",
],
lto: {
thin: true,
},
include_build_directory: false,
generated_headers: ["version_numbers.hpp"],
}

cc_library_static {
name: "realm",
defaults: [
"realm_consumer_defaults",
"realm_defaults",
],
cflags: [
"-fvisibility=hidden",
],
local_include_dirs: ["src/external"],
export_include_dirs: ["src"],
export_generated_headers: ["version_numbers.hpp"],
srcs: [
":IntelRDFPMathLib20U2",
":s2",
"src/realm/**/*.cpp",
],
exclude_srcs: [
"src/realm/tools/**/*",
"src/realm/exec/**/*",
"src/realm/sync/tools/**/*",
"src/realm/object-store/c_api/**/*",
"src/realm/object-store/impl/apple/**/*",
"src/realm/object-store/impl/emscripten/**/*",
"src/realm/object-store/impl/generic/**/*",
"src/realm/object-store/impl/windows/**/*",
"src/realm/object-store/sync/impl/emscripten/**/*",
],
export_shared_lib_headers: ["libcrypto"],
}
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,42 @@

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

# 13.21.0 Release notes

### Enhancements
* Allow non-embedded links in asymmetric objects. ([PR #6981](https://github.com/realm/realm-core/pull/6981))

### Fixed
* Logging into a single user using multiple auth providers created a separate SyncUser per auth provider. This mostly worked, but had some quirks:
- Sync sessions would not necessarily be associated with the specific SyncUser used to create them. As a result, querying a user for its sessions could give incorrect results, and logging one user out could close the wrong sessions.
- Existing local synchronized Realm files created using version of Realm from August - November 2020 would sometimes not be opened correctly and would instead be redownloaded.
- Removing one of the SyncUsers would delete all local Realm files for all SyncUsers for that user.
- Deleting the server-side user via one of the SyncUsers left the other SyncUsers in an invalid state.
- A SyncUser which was originally created via anonymous login and then linked to an identity would still be treated as an anonymous users and removed entirely on logout.
([PR #6837](https://github.com/realm/realm-core/pull/6837), since v10.0.0)
* Reading existing logged-in users on app startup from the sync metadata Realm performed three no-op writes per user on the metadata Realm ([PR #6837](https://github.com/realm/realm-core/pull/6837), since v10.0.0).
* If a user was logged out while an access token refresh was in progress, the refresh completing would mark the user as logged in again and the user would be in an inconsistent state ([PR #6837](https://github.com/realm/realm-core/pull/6837), since v10.0.0).
* If querying over a geospatial dataset that had some objects with a type property set to something other than 'Point' (case insensitive) an exception would have been thrown. Instead of disrupting the query, those objects are now just ignored. ([PR 6989](https://github.com/realm/realm-core/issues/6989), since the introduction of geospatial)
* The Swift package failed to link required libraries when building for macCatalyst.

### Breaking changes
* SyncUser::provider_type() and realm_user_get_auth_provider() have been removed. Users don't have provider types; identities do. `SyncUser::is_anonymous()` is a more correct version of checking if the provider type is anonymous ([PR #6837](https://github.com/realm/realm-core/pull/6837)).
* SyncUser no longer has a `local_identity()`. `identity()` has been guaranteed to be unique per App ever since v10 ([PR #6837](https://github.com/realm/realm-core/pull/6837)).
* SyncUser no longer overrides operator==. Pointer equality should be used to compare sync users ([PR #6837](https://github.com/realm/realm-core/pull/6837)).

### Compatibility
* Fileformat: Generates files with format v23. Reads and automatically upgrade from fileformat v5.
* The metadata Realm used to store sync users has had its schema version bumped. It is automatically migrated to the new version on first open. Downgrading to older version of Realm after upgrading will discard stored user tokens and require logging back in.

-----------

### Internals
* Update History Command tool to work with realms with fileformat v23 ([PR #6970](https://github.com/realm/realm-core/pull/6970))
* Don't edit the ObjectStore target to enable the libuv scheduler in tests, just register the factory instead. ([PR #6699](https://github.com/realm/realm-core/pull/6699))
* Removed the core metrics which were unused. ([PR 6990](https://github.com/realm/realm-core/pull/6990))

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

# 13.20.1 Release notes

### Enhancements
Expand All @@ -42,6 +78,7 @@
* When using SecureTransport (i.e. on Apple platforms) only some TLS errors were reported as `TlsHandshakeFailed` and most were reported as `SyncConnectFailed` ([PR #6938](https://github.com/realm/realm-core/pull/6938)).
* Sync errors originating from OpenSSL used the error message from the wrong end of the error stack, often resulting in very unhelpful error message ([PR #6938](https://github.com/realm/realm-core/pull/6938)).
* Sending empty UPLOAD messages may lead to 'Bad server version' errors and client reset. ([6966](https://github.com/realm/realm-core/issues/6966), since v11.8.0)
* Fix open async in order to invoke the subscription callback correctly when rerun_on_open is set to true. ([#6937](https://github.com/realm/realm-core/pull/6937), since v13.16.0).

### Breaking changes
* None.
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ if(NOT EMSCRIPTEN)
endif()
option(REALM_ENABLE_MEMDEBUG "Add additional memory checks" OFF)
option(REALM_VALGRIND "Tell the test suite we are running with valgrind" OFF)
option(REALM_METRICS "Enable various metric tracking" ON)
option(REALM_SYNC_MULTIPLEXING "Enables/disables sync session multiplexing by default" ON)
set(REALM_MAX_BPNODE_SIZE "1000" CACHE STRING "Max B+ tree node size.")
option(REALM_ENABLE_GEOSPATIAL "Enable geospatial types and queries." ON)
Expand Down
8 changes: 3 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import PackageDescription
import Foundation

let versionStr = "13.20.1"
let versionStr = "13.21.0"
let versionPieces = versionStr.split(separator: "-")
let versionCompontents = versionPieces[0].split(separator: ".")
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""
Expand Down Expand Up @@ -405,7 +405,6 @@ let package = Package(
"realm/CMakeLists.txt",
"realm/exec",
"realm/geospatial.cpp",
"realm/metrics",
"realm/object-store/CMakeLists.txt",
"realm/object-store/c_api",
"realm/object-store/impl/epoll",
Expand All @@ -428,8 +427,8 @@ let package = Package(
linkerSettings: [
.linkedLibrary("compression"),
.linkedLibrary("z"),
.linkedFramework("Foundation", .when(platforms: [.macOS, .iOS, .tvOS, .watchOS])),
.linkedFramework("Security", .when(platforms: [.macOS, .iOS, .tvOS, .watchOS])),
.linkedFramework("Foundation", .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
.linkedFramework("Security", .when(platforms: [.macOS, .iOS, .tvOS, .watchOS, .macCatalyst])),
]),
.target(
name: "RealmQueryParser",
Expand All @@ -453,7 +452,6 @@ let package = Package(
"external",
"realm/CMakeLists.txt",
"realm/exec",
"realm/metrics",
"realm/object-store",
"realm/parser",
"realm/sync/CMakeLists.txt",
Expand Down
2 changes: 1 addition & 1 deletion dependencies.list
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME=realm-core
VERSION=13.20.1
VERSION=13.21.0
OPENSSL_VERSION=3.0.8
ZLIB_VERSION=1.2.13
MDBREALM_TEST_SERVER_TAG=2023-08-11
21 changes: 21 additions & 0 deletions src/external/json/LICENSE.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2013-2022 Niels Lohmann

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
4 changes: 0 additions & 4 deletions src/realm.h
Original file line number Diff line number Diff line change
Expand Up @@ -3356,13 +3356,9 @@ RLM_API realm_user_state_e realm_user_get_state(const realm_user_t* user) RLM_AP
RLM_API bool realm_user_get_all_identities(const realm_user_t* user, realm_user_identity_t* out_identities,
size_t capacity, size_t* out_n);

RLM_API const char* realm_user_get_local_identity(const realm_user_t*) RLM_API_NOEXCEPT;

// returned pointer must be manually released with realm_free()
RLM_API char* realm_user_get_device_id(const realm_user_t*) RLM_API_NOEXCEPT;

RLM_API realm_auth_provider_e realm_user_get_auth_provider(const realm_user_t*) RLM_API_NOEXCEPT;

/**
* Log out the user and mark it as logged out.
*
Expand Down
11 changes: 0 additions & 11 deletions src/realm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@ set(REALM_INSTALL_HEADERS
util/to_string.hpp
util/type_traits.hpp
util/uri.hpp

metrics/metrics.hpp
metrics/metric_timer.hpp
metrics/query_info.hpp
metrics/transaction_info.hpp
) # REALM_INSTALL_HEADERS

set(REALM_NOINST_HEADERS
Expand All @@ -284,12 +279,6 @@ set(REALM_NOINST_HEADERS
util/value_reset_guard.hpp
) # REALM_NOINST_HEADERS

list(APPEND REALM_SOURCES
metrics/metrics.cpp
metrics/metric_timer.cpp
metrics/query_info.cpp
metrics/transaction_info.cpp)

if(NOT MSVC)
list(APPEND REALM_SOURCES util/interprocess_mutex.cpp)
endif()
Expand Down
4 changes: 2 additions & 2 deletions src/realm/cluster_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,15 +987,15 @@ size_t ClusterTree::get_ndx(ObjKey k) const noexcept

void ClusterTree::erase(ObjKey k, CascadeState& state)
{
m_owner->free_local_id_after_hash_collision(k);
m_owner->erase_from_search_indexes(k);
if (!k.is_unresolved()) {
if (auto table = get_owning_table()) {
if (Replication* repl = table->get_repl()) {
repl->remove_object(table, k);
}
}
}
m_owner->free_local_id_after_hash_collision(k);
m_owner->erase_from_search_indexes(k);

size_t root_size = m_root->erase(k, state);

Expand Down
2 changes: 1 addition & 1 deletion src/realm/collection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ using CollectionPtr = std::shared_ptr<Collection>;
/// Collections are bound to particular properties of an object. In a
/// collection's public interface, the implementation must take care to keep the
/// object consistent with the persisted state, mindful of the fact that the
/// state may have changed as a consquence of modifications from other instances
/// state may have changed as a consequence of modifications from other instances
/// referencing the same persisted state.
class CollectionBase : public Collection {
public:
Expand Down
Loading

0 comments on commit d1e96be

Please sign in to comment.