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

Implement a new approach to communicating serialised Realm objects between device and plugin #121

Closed
gagik opened this issue Jan 6, 2023 · 0 comments · Fixed by #123
Closed
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@gagik
Copy link
Contributor

gagik commented Jan 6, 2023

The current approach for sending over Realm object information between the plugin and the device has variety of issues.

A new implementation should likely address multiple existing issues at once. Based on the summary of previous issues, here are some possible considerations for the new implementation:

  1. Wrap serialised Realm Objects with parent objects that store i.e. _pluginObjectKey rather than introduce those fields to the serialised object itself (as described by Special property names #86 and fixes Object Key in data inspector #93)
  2. In the wrapper of the serialised object being sent over to the plugin (or other place that may make more sense), include information that can be used to derive types of i.e. mixed fields. (fixes Type erasure and support for mixed #84)
  3. When sending an object that has a linked object, it would be enough to send the objectKey (and primaryKey if present). The primaryKey could be used to nicely render the linked objects in the table. (fixes Flattening of linked objects #85).
  4. Do not attempt to query embedded objects (fixes Embedded Object Support #113)
  5. Use latest toJSON serialiser to avoid circular dependency issues (fixes Circular references #96). With new toJSON implementation from Improve toJSON functionality and remove JSONSerializerReplacer realm-js#4997, it should now be easier to represent and serialize Realm objects as plain JavaScript objects which will hopefully ease some complexity.
@gagik gagik added bug Something isn't working enhancement New feature or request labels Jan 6, 2023
@gagik gagik self-assigned this Jan 16, 2023
@gagik gagik linked a pull request Jan 18, 2023 that will close this issue
4 tasks
@gagik gagik closed this as completed Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
1 participant