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

fromEjson() throws "Missing decoder for type Set" #1761

Closed
lhengl opened this issue Jul 29, 2024 · 1 comment · Fixed by #1736
Closed

fromEjson() throws "Missing decoder for type Set" #1761

lhengl opened this issue Jul 29, 2024 · 1 comment · Fixed by #1736

Comments

@lhengl
Copy link

lhengl commented Jul 29, 2024

What happened?

The fromEjson() function throws when using Set/RealmSet. The following error will be encountered:

"Missing decoder for type Set"

Repro steps

Define a Realm model with a field of type Set.

Instantiate the model and then call the fromEjson(object) function on the object.

Version

Flutter 3.22.2

What Atlas Services are you using?

Atlas Device Sync

What type of application is this?

Flutter Application

Client OS and version

Any

Code snippets

class $MyClass {
@PrimaryKey()
@mapto('_id')
late ObjectId id;
late Set<String> mySet;
}

// call fromEjson will throw "Missing decoder for type Set"
final realmObject = fromEjson({
  '_id' : {
    '$oid' : ObjectId().hexString,
  },
  'mySet' : {'value1', 'value2'},
});

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

Copy link

sync-by-unito bot commented Jul 29, 2024

➤ PM Bot commented:

Jira ticket: RDART-1080

@nielsenko nielsenko self-assigned this Jul 29, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants