Skip to content

Type issues with Unmanaged<T, RequiredProperties> #6037

@Yupeng-li

Description

@Yupeng-li

How frequently does the bug occur?

Always

Description

When using Realm classes, we noticed a few type issues all related to Unmanaged<T, RequiredKeys>.

  1. When specifying the RequiredProperties in Realm.Object<T, RequiredProperties>, the properties of type Realm.List or Realm.Dictionary are not allowed.
  2. If RequiredProperties is not provided when defining the class, the constructor accepts string as values.
  3. Unmanaged nested Realm.Object is not allowed in Realm.create. It's also reported in Unmanaged type doesn't cascade through links #5940

The details are available in the mini repo I attached.

If anyone is interested, I made a patch to resolve the issue 1 & 3 for now. https://gist.github.com/Yupeng-li/655eaf75f46086c4345a78e27dfa3c5e

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

Please check this codesandbox mini repo for details. (Please ignore the browser view on the right hand side. )

Version

11.7 & 11.9

What services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

All

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions