Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to HEAD of Realm Core's master #6637

Merged
merged 17 commits into from
May 1, 2024
Merged

Upgrade to HEAD of Realm Core's master #6637

merged 17 commits into from
May 1, 2024

Conversation

kneth
Copy link
Contributor

@kneth kneth commented Apr 25, 2024

What, How & Why?

Next core release will come with a number of breaking changes. This PR is a preparation for the release, and it requires realm/realm-core#7623 to be merged and release.

The Binding Generator has some limitations, and in conjunction with realm/realm-core#7623 this PR works around them.

In realm/realm-core#7300, a new user is introduced (app::User) which inherit from SyncUser. As both classes are used with std::shared_ptr (annotated SharedPtrWrapper in spec.xml), it is not possible to generate code. The solution hack is to downcast all objects. In most cases the downcasting has no effect but for the user classes. For user classes we will use only one - app::User - and downcast SyncUser to app::User.

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 📝 Update COMPATIBILITY.md
  • 🚦 Tests
  • 📦 Updated internal package version in consuming package.jsons (if updating internal packages)
  • 📱 Check the React Native/other sample apps work if necessary
  • 💥 Breaking label has been applied or is not necessary

@cla-bot cla-bot bot added the cla: yes label Apr 25, 2024
@kneth kneth added no-changelog no-jira-ticket Skip checking the PR title for Jira reference and removed cla: yes labels Apr 25, 2024
Copy link
Member

@kraenhansen kraenhansen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a lot of good simplifications. If it passes tests I'm fine with merging it as part of an upgrade to Core 👍

In most cases the downcasting has no effect but for the user classes

🤞 We didn't test the performance of this, right? I mean - its a pretty critical code path.

@cla-bot cla-bot bot added the cla: yes label Apr 25, 2024
@kneth
Copy link
Contributor Author

kneth commented Apr 25, 2024

We didn't test the performance of this, right? I mean - its a pretty critical code path.

I have changed it so we don't downcast but I hope that a C++ compiler will generate very little code for

Foo *foo = new Foo();
auto bar = std::dynamic_pointer_cast<Foo>(foo);

@kneth kneth marked this pull request as ready for review April 25, 2024 18:51
@kneth kneth requested a review from elle-j April 25, 2024 18:51
Copy link
Contributor

@elle-j elle-j left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for tackling this! I've left some comments that would be good to resolve before merge 👍

integration-tests/tests/src/tests/queries.ts Outdated Show resolved Hide resolved
integration-tests/tests/src/tests/queries.ts Outdated Show resolved Hide resolved
packages/realm/bindgen/src/templates/jsi.ts Show resolved Hide resolved
packages/realm/bindgen/src/templates/node.ts Show resolved Hide resolved
packages/realm/src/app-services/App.ts Outdated Show resolved Hide resolved
packages/realm/src/app-services/App.ts Outdated Show resolved Hide resolved
},
);
userAgentBindingInfo: App.userAgent,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting 👍

Suggested change
}
},

packages/realm/src/app-services/App.ts Outdated Show resolved Hide resolved
packages/realm/src/app-services/SyncSession.ts Outdated Show resolved Hide resolved
packages/realm/src/app-services/SyncSession.ts Outdated Show resolved Hide resolved
@kneth kneth merged commit 38ab585 into main May 1, 2024
32 checks passed
@kneth kneth deleted the kneth/core branch May 1, 2024 20:14
papafe added a commit that referenced this pull request May 23, 2024
* 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
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes no-changelog no-jira-ticket Skip checking the PR title for Jira reference
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants