Skip to content

Commit

Permalink
Merge branch 'main' into fp/collections-mixed-sync-tests
Browse files Browse the repository at this point in the history
* main: (22 commits)
  Prepare for vNext (#6677)
  [12.9.0] Bump version (#6676)
  Fix performance tests (#6665)
  Combined: Support `Mixed` data type with collections (#6613)
  Update expected error messages (#6674)
  Adding --latest-local to the baas test server CLI (#6673)
  Upgrade to Realm Core v14.7.0 (#6663)
  Upgrade @trunk/launcher to v1.3.1 to support Apple's versioning scheme for macOS (#6671)
  Prepare for vNext (#6669)
  [12.8.1] Bump version (#6668)
  Use unreleased core (#6667)
  Fix realm/react changelog (#6661)
  Fix GHA error when publishing package release (#6660)
  Prepend vNext to realm/react changelog.
  [realm-react-0.7.0] Bump version (#6658)
  Update OAuth2Helper to remove accessing the stitch prefix (#6659)
  Fix unresolvable links in API reference docs and remove re-exports (#6646)
  Prepare for vNext (#6645)
  [12.8.0] Bump version (#6643)
  Upgrade to HEAD of Realm Core's master (#6637)
  ...

# Conflicts:
#	CHANGELOG.md
#	integration-tests/tests/src/tests/mixed.ts
  • Loading branch information
papafe committed May 23, 2024
2 parents a25a346 + 04c598e commit b9ddb0d
Show file tree
Hide file tree
Showing 42 changed files with 519 additions and 222 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish-package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
steps:
- run: echo "Publishing release for ${{inputs.package}}"
- uses: kanga333/variable-mapper@v0.3.0
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.header.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
### Compatibility
* React Native >= v0.71.4
* Realm Studio v15.0.0.
* File format: generates Realms with format v24 (reads and upgrades file format v10.
* File format: generates Realms with format v24 (reads and upgrades file format v10).

### Internal
<!-- * Either mention core version or upgrade -->
<!-- * Using Realm Core vX.Y.Z -->
<!-- * Upgraded Realm Core from vX.Y.Z to vA.B.C -->
<!-- * Upgraded Realm Core from vX.Y.Z to vA.B.C -->
84 changes: 77 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
## vNext (TBD)

### Deprecations
* None

### Enhancements
* None

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
* None

### 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
<!-- * Either mention core version or upgrade -->
<!-- * Using Realm Core vX.Y.Z -->
<!-- * Upgraded Realm Core from vX.Y.Z to vA.B.C -->

## 12.9.0 (2024-05-23)

### Enhancements
* A `mixed` value can now hold a `Realm.List` and `Realm.Dictionary` with nested collections. Note that `Realm.Set` is not supported as a `mixed` value. ([#6613](https://github.com/realm/realm-js/pull/6613))
```typescript
Expand Down Expand Up @@ -61,18 +83,66 @@ function expectDictionary(value: unknown): asserts value is Realm.Dictionary {
```

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-js/issues/????), since v?.?.?)
* None
* Inserting the same typed link to the same key in a dictionary more than once would incorrectly create multiple backlinks to the object. This did not appear to cause any crashes later, but would have affecting explicit backlink count queries (eg: `...@links.@count`) and possibly notifications ([realm/realm-core#7676](https://github.com/realm/realm-core/issues/7676) since v12.7.1).
* Having links in a nested collections would leave the file inconsistent if the top object is removed. ([realm/realm-core#7657](https://github.com/realm/realm-core/issues/7657), since v12.7.0)
* Automatic client reset recovery would crash when recovering AddInteger instructions on a Mixed property if its type was changed to non-integer ([realm/realm-core#7683](https://github.com/realm/realm-core/pull/7683), since v10.18.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 or later).
* File format: generates Realms with format v24 (reads and upgrades file format v10).

### Internal
<!-- * Either mention core version or upgrade -->
<!-- * Using Realm Core vX.Y.Z -->
<!-- * Upgraded Realm Core from vX.Y.Z to vA.B.C -->
* Upgraded Realm Core from v14.6.2 to v14.7.0.
* Upgraded `@trunk/launcher` from v1.3.0 to v1.3.1 to support Apple's versioning scheme for macOS.

## 12.8.1 (2024-05-15)

### Fixed
* Fixed a crash experienced on React Native when accessing `Realm.deleteFile`, `Realm.exists`, `Realm.schemaVersion`, `Realm.determinePath`, `Realm.transformConfig` and `User#isLoggedIn`. ([#6662](https://github.com/realm/realm-js/pull/6662), since v12.8.0)
* Accessing `Realm.App#currentUser` from within a notification produced by `Realm.App.switchUser` (which includes notifications for a newly logged in user) would deadlock. ([realm/realm-core#7670](https://github.com/realm/realm-core/issues/7670), since v12.8.0)
* Fixed a bug when running an `IN` query on a `string`/`int`/`uuid`/`objectId` property that was indexed. ([realm/realm-core#7642](https://github.com/realm/realm-core/issues/7642) since v12.8.0)
* Fixed a bug when running an `IN` query on an `int` property where `double`/`float` parameters were ignored. ([realm/realm-core#7642](https://github.com/realm/realm-core/issues/7642) 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.6.1 to v14.6.2 + commits `5ba02142131efa3d97eda770ce33a85a2a085202` and `5462d47998b86459d328648c8057790a7b92af20`.

## 12.8.0 (2024-05-01)

### Deprecations
* `MetadataMode.NoMetadata` is deprecated and will be removed. The new name is `MetadataMode.InMemory`.

### Enhancements
* Experimental feature: The new instance members `App.baseUrl` and `App.updateBaseUrl()` allow for retrieving and updating the base URL currently used for requests sent to Atlas App Services. These APIs are only available after importing `"realm/experimental/base-url"`. ([#6518](https://github.com/realm/realm-js/pull/6518))
* Improved performance of "chained OR equality" queries for `uuid`/`objectId` types and RQL parsed `IN` queries on `string`/`int`/`uuid`/`objectId` types. ([realm/realm-dotnet#3566](https://github.com/realm/realm-dotnet/issues/3566), since the introduction of these types)

### Fixed
* Fixed a bug when running an `IN` query (or a query of the pattern `x == 1 OR x == 2 OR x == 3`) when evaluating on a string property with an empty string in the search condition. Matches with an empty string would have been evaluated as if searching for a null string instead. ([realm/realm-core#7628](https://github.com/realm/realm-core/pull/7628), since v10.0.0)
* `App.allUsers()` included logged out users only if they were logged out while the `App` instance existed. It now always includes all logged out users. ([realm/realm-core#7300](https://github.com/realm/realm-core/pull/7300))
* Deleting the active user left the active user unset rather than selecting another logged-in user as the active user like logging out and removing users did. ([realm/realm-core#7300](https://github.com/realm/realm-core/pull/7300))
* Fixed several issues around encrypted file portability (copying a "bundled" encrypted Realm from one device to another):
* Fixed `Assertion failed: new_size % (1ULL << m_page_shift) == 0` when opening an encrypted Realm less than 64Mb that was generated on a platform with a different page size than the current platform. ([#realm/realm-core#7322](https://github.com/realm/realm-core/issues/7322), since v12.0.0-rc.3)
* Fixed an exception thrown when opening a small (<4k of data) Realm generated on a device with a page size of 4k if it was bundled and opened on a device with a larger page size. (since v1.0.0)
* Fixed an issue during a subsequent open of an encrypted Realm for some rare allocation patterns when the top ref was within ~50 bytes of the end of a page. This could manifest as an exception or as an assertion `encrypted_file_mapping.hpp:183: Assertion failed: local_ndx < m_page_state.size()`. ([realm/realm-core#7319](https://github.com/realm/realm-core/issues/7319))
* Schema initialization could hit an assertion failure if the sync client applied a downloaded changeset while the Realm file was in the process of being opened. ([realm/realm-core#7041](https://github.com/realm/realm-core/issues/7041), since v10.8.0)
* Queries using query paths on `mixed` values returns inconsistent results. ([realm/realm-core#7587](https://github.com/realm/realm-core/issues/7587), since v12.7.0-rc.0)

### Known issues
* Missing initial download progress notification when there is no active downloads. ([realm/realm-core#7627](https://github.com/realm/realm-core/issues/7627))

### 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.5.1 to v14.6.1.
* The metadata disabled mode (`MetadataMode.NoMetadata`) has been replaced with an in-memory metadata mode (`MetadataMode.InMemory`) which performs similarly and doesn't work weirdly differently from the normal mode. The new mode is intended for testing purposes, but should be suitable for production usage if there is a scenario where metadata persistence is not needed. ([realm/realm-core#7300](https://github.com/realm/realm-core/pull/7300))

## 12.7.1 (2024-04-19)

Expand Down Expand Up @@ -1008,4 +1078,4 @@ realm.write(() => {

### Internal
* Re-implemented the entire SDK leveraging code generation for the binding between NAPI / JSI and Realm Core.
* Renamed our `master` branch to `main`.
* Renamed our `master` branch to `main`.
17 changes: 14 additions & 3 deletions integration-tests/baas-test-server/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ yargs(hideBin(process.argv))
.command(
["docker [githash]"],
"Runs the BaaS test image using Docker",
(yargs) => yargs.positional("githash", { type: "string" }).option("branch", { default: "master" }),
(yargs) =>
yargs
.positional("githash", { type: "string" })
.option("branch", { default: "master" })
.option("latest-local", { default: false, boolean: true }),
wrapCommand(async (argv) => {
const { AWS_PROFILE, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY } = process.env;
assert(AWS_ACCESS_KEY_ID && AWS_SECRET_ACCESS_KEY, "Missing AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY env");
Expand All @@ -95,12 +99,19 @@ yargs(hideBin(process.argv))
docker.ensureNoBaas();

if (argv.githash) {
docker.spawnBaaS({ tag: argv.githash, accessKeyId: AWS_ACCESS_KEY_ID, secretAccessKey: AWS_SECRET_ACCESS_KEY });
docker.spawnBaaS({
image: argv.githash,
accessKeyId: AWS_ACCESS_KEY_ID,
secretAccessKey: AWS_SECRET_ACCESS_KEY,
});
} else if (argv["latest-local"]) {
const id = docker.getLatestLocalId();
docker.spawnBaaS({ image: id, accessKeyId: AWS_ACCESS_KEY_ID, secretAccessKey: AWS_SECRET_ACCESS_KEY });
} else {
const tag = await docker.fetchBaasTag(argv.branch);
assert(AWS_PROFILE, "Missing AWS_PROFILE env");
docker.pullBaas({ profile: AWS_PROFILE, tag });
docker.spawnBaaS({ tag, accessKeyId: AWS_ACCESS_KEY_ID, secretAccessKey: AWS_SECRET_ACCESS_KEY });
docker.spawnBaaS({ image: tag, accessKeyId: AWS_ACCESS_KEY_ID, secretAccessKey: AWS_SECRET_ACCESS_KEY });
}
}),
)
Expand Down
22 changes: 18 additions & 4 deletions integration-tests/baas-test-server/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const BAAS_CONTAINER_NAME = "baas-test-server";
const BAAS_PORT = 9090;
const BAAS_VARIANT = process.arch === "arm64" ? "ubuntu2004-arm64" : "ubuntu2004-docker";
const ECR_HOSTNAME = "969505754201.dkr.ecr.us-east-1.amazonaws.com";
const ECR_PATHNAME = "/baas-test-images/test_server-race";

function registerExitListeners(logPrefix: string, child: cp.ChildProcess) {
function killChild() {
Expand Down Expand Up @@ -88,6 +89,19 @@ export async function fetchBaasTag(branch: string) {
}
}

export function getLatestLocalId() {
const imagesOutput = execSync("docker images --format json", { encoding: "utf8" });
for (const line of imagesOutput.split("\n")) {
if (line) {
const image = JSON.parse(line.trim());
if (image.Repository === ECR_HOSTNAME + ECR_PATHNAME && image.Tag.startsWith(BAAS_VARIANT)) {
return image.ID;
}
}
}
throw new Error("Unable to infer the latest local tag");
}

export function pullBaas({ profile, tag }: { profile: string; tag: string }) {
try {
execSync(`docker pull ${tag}`, { stdio: "inherit" });
Expand All @@ -103,15 +117,15 @@ export function pullBaas({ profile, tag }: { profile: string; tag: string }) {
}

export function spawnBaaS({
tag,
image,
accessKeyId,
secretAccessKey,
}: {
tag: string;
image: string;
accessKeyId: string;
secretAccessKey: string;
}) {
console.log("Starting server from tag", chalk.dim(tag));
console.log("Starting server from tag", chalk.dim(image));
spawn(chalk.blueBright("baas"), "docker", [
"run",
"--name",
Expand All @@ -124,6 +138,6 @@ export function spawnBaaS({
`AWS_SECRET_ACCESS_KEY=${secretAccessKey}`,
"--publish",
`${BAAS_PORT}:${BAAS_PORT}`,
tag,
image,
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ PODS:
- React-Core
- React-jsi
- ReactTestApp-Resources (1.0.0-dev)
- RealmJS (12.7.0-rc.0):
- RealmJS (12.7.1):
- React
- RNFS (2.20.0):
- React-Core
Expand Down Expand Up @@ -1356,7 +1356,7 @@ SPEC CHECKSUMS:
ReactNativeHost: 446b46cbfc2d16420bfd249e9064802e929fa9b7
ReactTestApp-DevSupport: 5cd1b02b4d146811d29dc2455a249f0743fda504
ReactTestApp-Resources: d200e68756fa45c648f369210bd7ee0c14759f5a
RealmJS: 0c85b5fd6406447f4526d7b73d0a8025cd8b342a
RealmJS: 3fdc3b6cb6d4ff67eaf0e5f7f861be51304e7525
RNFS: 4ac0f0ea233904cb798630b3c077808c06931688
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: 805bf71192903b20fc14babe48080582fee65a80
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
////////////////////////////////////////////////////////////////////////////

const { makeMetroConfig } = require("@rnx-kit/metro-config");

module.exports = makeMetroConfig({
transformer: {
getTransformOptions: async () => ({
Expand Down
15 changes: 5 additions & 10 deletions integration-tests/tests/src/hooks/import-app-before.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//
////////////////////////////////////////////////////////////////////////////

import Realm from "realm";
import Realm, { AppConfiguration } from "realm";

import { AppConfig, AppImporter, Credentials } from "@realm/app-importer";
import { mongodbServiceType } from "../utils/ExtendedAppConfigBuilder";
Expand All @@ -39,14 +39,6 @@ export { baseUrl };

const allowSkippingServerTests = typeof environment.baseUrl === "undefined" && missingServer !== false;

export type AppConfigurationRelaxed = {
id?: string;
baseUrl?: string;
timeout?: number;
multiplexSessions?: boolean;
baseFilePath?: string;
};

const credentials: Credentials =
typeof publicKey === "string" && typeof privateKey === "string"
? {
Expand Down Expand Up @@ -94,7 +86,10 @@ function ensureSkippedAppImportAfterHook() {
* If the `missingServer` context is set the suite will be skipped.
* If the import fails due to a connection refusal, the suite will be skipped and a warning printed at the end of the test run.
*/
export function importAppBefore(config: AppConfig | { config: AppConfig }, sdkConfig?: AppConfigurationRelaxed): void {
export function importAppBefore(
config: AppConfig | { config: AppConfig },
sdkConfig?: Partial<AppConfiguration>,
): void {
// Unwrap when passed a builder directly
if ("config" in config) {
return importAppBefore(config.config, sdkConfig);
Expand Down
Loading

0 comments on commit b9ddb0d

Please sign in to comment.