Skip to content

Realm JavaScript v12.10.0

Compare
Choose a tag to compare
@github-actions github-actions released this 14 Jun 11:18
· 95 commits to main since this release
c0f32c5

Enhancements

  • Report the originating error that caused a client reset to occur. (realm/realm-core#6154)
  • Reduce the size of the local transaction log produced by creating objects, improving the performance of insertion-heavy transactions. (realm/realm-core#7734)
  • A counter presentation data type has been introduced. The int data type can now be used as a logical counter for performing numeric updates that need to be synchronized as sequentially consistent events rather than individual reassignments of the number. (#6694)
    • See the API docs for more information about the usage, or get a high-level introduction about counters in the documentation.
class MyObject extends Realm.Object {
  _id!: BSON.ObjectId;
  counter!: Realm.Types.Counter;

  static schema: ObjectSchema = {
    name: "MyObject",
    primaryKey: "_id",
    properties: {
      _id: { type: "objectId", default: () => new BSON.ObjectId() },
      counter: "counter",
      // or: counter: { type: "int", presentation: "counter" },
    },
  };
}

const realm = await Realm.open({ schema: [MyObject] });
const object = realm.write(() => {
  return realm.create(MyObject, { counter: 0 });
});

realm.write(() => {
  object.counter.increment();
  object.counter.value; // 1
  object.counter.decrement(2);
  object.counter.value; // -1
});

Fixed

  • After compacting, a file upgrade would be triggered. This could cause loss of data for synced Realms. (realm/realm-core#7747, since 12.7.0-rc.0)
  • The function immediatelyRunFileActions was not added to the bindgen's opt-list. This could lead to the error TypeError: app.internal.immediatelyRunFileActions is not a function. (#6708, since v12.8.0)
  • Encrypted files on Windows had a maximum size of 2 GB even on x64 due to internal usage of off_t, which is a 32-bit type on 64-bit Windows. (realm/realm-core#7698, since the introduction of encryption support on Windows - likely in v1.11.0)
  • Tokenizing strings for full-text search could lead to undefined behavior. (realm/realm-core#7698, since v11.3.0-rc.0)
  • A non-streaming progress notifier would not immediately call its callback after registration. Instead you would have to wait for a download message to be received to get your first update - if you were already caught up when you registered the notifier you could end up waiting a long time for the server to deliver a download that would call/expire your notifier. (#7627, since v12.8.0)

Compatibility

  • React Native >= v0.71.4
  • Realm Studio v15.0.0.
  • File format: generates Realms with format v24 (reads and upgrades file format v10).

Internal

  • Upgraded Realm Core from v14.7.0 to v14.10.0. (#6701)
  • Added privacy manifest for Apple App Store. First released in v12.8.1-alpha.0 only. (#6638)