Skip to content

Commit

Permalink
Add sync integration test for in-memory mode (#5955)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbreams authored Oct 21, 2022
1 parent cb62ab5 commit 20b00c9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
* None.

### Breaking changes
* None.
* Websocket errors caused by the client sending a websocket message that is too large (i.e. greater than 16MB) now get reported as a `ProtocolError::limits_exceeded` error with a `ClientReset` requested by the server ([#5209](https://github.com/realm/realm-core/issues/5209)).

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

-----------

### Internals
* Added integration test for opening synchronized realms as in-memory realms ([#5955](https://github.com/realm/realm-core/pull/5955)).
* Added realm core version to the app login request ([#5959](https://github.com/realm/realm-core/issues/5959))

----------------------------------------------
Expand All @@ -36,7 +37,6 @@
### Breaking changes
* Rename RealmConfig::automatic_handle_backlicks_in_migrations to RealmConfig::automatically_handle_backlinks_in_migrations ([PR #5897](https://github.com/realm/realm-core/pull/5897)).
* Introduced new callback type realm_return_apikey_list_func_t and realm_return_apikey_func_t in the C-API ([PR #5945](https://github.com/realm/realm-core/pull/5945)).
* Websocket errors caused by the client sending a websocket message that is too large (i.e. greater than 16MB) now get reported as a `ProtocolError::limits_exceeded` error with a `ClientReset` requested by the server ([#5209](https://github.com/realm/realm-core/issues/5209)).

### Compatibility
* Fileformat: Generates files with format v22. Reads and automatically upgrade from fileformat v5.
Expand Down
25 changes: 25 additions & 0 deletions test/object-store/sync/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2063,6 +2063,31 @@ TEST_CASE("app: sync integration", "[sync][app]") {
}
}

SECTION("MemOnly durability") {
{
SyncTestFile config(app, partition, schema);
config.in_memory = true;

REQUIRE(config.options().durability == DBOptions::Durability::MemOnly);
auto r = Realm::get_shared_realm(config);

REQUIRE(get_dogs(r).size() == 0);
create_one_dog(r);
REQUIRE(get_dogs(r).size() == 1);
}

{
create_user_and_log_in(app);
SyncTestFile config(app, partition, schema);
config.in_memory = true;
auto r = Realm::get_shared_realm(config);
Results dogs = get_dogs(r);
REQUIRE(dogs.size() == 1);
REQUIRE(dogs.get(0).get<String>("breed") == "bulldog");
REQUIRE(dogs.get(0).get<String>("name") == "fido");
}
}

// MARK: Expired Session Refresh -
SECTION("Invalid Access Token is Refreshed") {
{
Expand Down

0 comments on commit 20b00c9

Please sign in to comment.