Skip to content

Commit

Permalink
Solve PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaafanador3 committed Jan 23, 2024
1 parent aebbcaa commit cc681a5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ x.y.z Release notes (yyyy-MM-dd)
* The `baseURL` field of `AppConfiguration` can now be updated, rather than the
value being persisted between runs of the application in the metadata
storage. ([Core #7201](https://github.com/realm/realm-core/issues/7201))
* Allow in-memory synced Realms. This will allow setting and in-memory identifier on
flexible sync realms, this will not create a .realm file or its associated auxiliary
files for the synced realm and instead stores objects in memory while the realm is
open and discards them immediately when all instances are closed.
* Allow in-memory synced Realms. This will allow setting an in-memory identifier on
a flexible sync realm.

### Fixed
* `@Persisted`'s Encodable implementation did not allow the encoder to
Expand Down
8 changes: 4 additions & 4 deletions Realm/ObjectServerTests/AsyncSyncTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -522,15 +522,15 @@ class AsyncFlexibleSyncTests: SwiftSyncTestCase {
try await Task {
var config = user.flexibleSyncConfiguration(initialSubscriptions: { subs in
subs.append(QuerySubscription<SwiftPerson> {
$0.age > 0 && $0.firstName == "\(#function)"
$0.age > 0 && $0.firstName == self.name
})
})
config.objectTypes = [SwiftPerson.self]
config.inMemoryIdentifier = "identifier"
let inMemoryRealm = try await Realm(configuration: config, downloadBeforeOpen: .always)
XCTAssertEqual(inMemoryRealm.objects(SwiftPerson.self).count, 5)
try! inMemoryRealm.write {
let person = SwiftPerson(firstName: "\(#function)",
let person = SwiftPerson(firstName: self.name,
lastName: "lastname_10",
age: 10)
inMemoryRealm.add(person)
Expand All @@ -541,7 +541,7 @@ class AsyncFlexibleSyncTests: SwiftSyncTestCase {

var config = user.flexibleSyncConfiguration(initialSubscriptions: { subs in
subs.append(QuerySubscription<SwiftPerson> {
$0.age > 5 && $0.firstName == "\(#function)"
$0.age > 5 && $0.firstName == self.name
})
})
config.objectTypes = [SwiftPerson.self]
Expand All @@ -551,7 +551,7 @@ class AsyncFlexibleSyncTests: SwiftSyncTestCase {

var config2 = user.flexibleSyncConfiguration(initialSubscriptions: { subs in
subs.append(QuerySubscription<SwiftPerson> {
$0.age > 0 && $0.firstName == "\(#function)"
$0.age > 0 && $0.firstName == self.name
})
})
config2.objectTypes = [SwiftPerson.self]
Expand Down
2 changes: 1 addition & 1 deletion Realm/RLMRealmConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ typedef void(^RLMFlexibleSyncInitialSubscriptionsBlock)(RLMSyncSubscriptionSet *

#pragma mark - Properties

/// The local URL of the Realm file. Mutually exclusive with `inMemoryIdentifier`,
/// The local URL of the Realm file. Mutually exclusive with `inMemoryIdentifier`;
/// setting one of the two properties will automatically nil out the other.
@property (nonatomic, copy, nullable) NSURL *fileURL;

Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/RealmConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extension Realm {
/**
Creates a `Configuration` which can be used to create new `Realm` instances.
- note: The `fileURL`, `inMemoryIdentifier`, parameters are mutually exclusive. Only
- note: The `fileURL`, and `inMemoryIdentifier`, parameters are mutually exclusive. Only
set one of them, or none if you wish to use the default file URL.
Synced Realms will set a unique file path unless is an in-memory realm.
Expand Down

0 comments on commit cc681a5

Please sign in to comment.