Skip to content

Commit

Permalink
Changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Duncalf committed Apr 29, 2022
1 parent 4c0cc9c commit 621a89d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ x.x.x Release notes (yyyy-MM-dd)
* Fixed issue where React Native apps would sometimes show stale Realm data until the user interacted with the app UI ([#4389](https://github.com/realm/realm-js/issues/4389), since v10.0.0)
* Fixed race condition leading to potential crash when hot reloading an app using Realm Sync ([4509](https://github.com/realm/realm-js/pull/4509), since v10.12.0)
* Updated build script to use Xcode 12.4 to ensure xcframework is Bitcode compatibile with older versions ([#4462](https://github.com/realm/realm-js/issues/4462), since v10.0.0)
* Proxied `Realm.Results` (e.g. as returned from `useQuery` in `@realm/react`) could not be used with `MutableSubscriptionSet.add`/`remove` ([#4507](https://github.com/realm/realm-js/issues/4507), since v10.12.0)
* Adding an object to a Set, deleting the parent object, and then deleting the previously mentioned object causes crash ([#5387](https://github.com/realm/realm-core/issues/5387), since v10.5.0)
* Synchronized Realm files which were first created using SDK version released in the second half of August 2020 would be redownloaded instead of using the existing file, possibly resulting in the loss of any unsynchronized data in those files (since v10.10.1).

Expand Down
8 changes: 4 additions & 4 deletions lib/mutable-subscription-set.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2021 Realm Inc.
// Copyright 2022 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////

import { symbols } from "@realm.io/common";
const { symbols } = require("@realm.io/common");

// React Native `Proxy` objects when not using JSI are not compatible with
// `JSValueIsObjectOfClass`, because it seems JSC is not able to "unwrap"
Expand All @@ -29,14 +29,14 @@ import { symbols } from "@realm.io/common";
// if so we pass the original unproxied results to C++.
//
// Once our v11 branch is merged, we can revert this change as JSI React Native `Proxy`s
// work fine, by reverting PR #xxxx.
// work fine, by reverting PR #4541.
const instanceMethods = (realmConstructor) => ({
add(query, options) {
return this._add(query[symbols.REALM_REACT_PROXIED_OBJECT] || query, options);
},

remove(query) {
return this._remove(query[symbols.REALM_REACT_PROXIED_OBJECT]);
return this._remove(query[symbols.REALM_REACT_PROXIED_OBJECT] || query);
}
});

Expand Down
20 changes: 19 additions & 1 deletion packages/realm-common/src/symbols.ts
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
export const REALM_REACT_PROXIED_OBJECT = Symbol('REALM_REACT_PROXIED_OBJECT');
////////////////////////////////////////////////////////////////////////////
//
// Copyright 2022 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

export const REALM_REACT_PROXIED_OBJECT = Symbol("REALM_REACT_PROXIED_OBJECT");
1 change: 1 addition & 0 deletions packages/realm-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const SomeComponent = () => {

### Fixed
* Fixed potential "Cannot create asynchronous query while in a write transaction" error with `useObject` due to adding event listeners while in a write transaction ([#4375](https://github.com/realm/realm-js/issues/4375), since v0.1.0)
* Results from `useQuery` could not be passed to `MutableSubscriptionSet.add`/`remove` ([#4507](https://github.com/realm/realm-js/issues/4507), since v0.1.0)

### Compatibility
* None.
Expand Down

0 comments on commit 621a89d

Please sign in to comment.