question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

changset.get on a belongsTo relationship returns a proxy

See original GitHub issue

Relates to #543

@snewcomer thank you for getting that fix merged in so quickly for the mergeDeep issue on a hasMany! 💪

In testing out the v3.9.2 we realized we are still experiencing this issue in belongsTo relationships as well.

I have to take a break from the keyboard for a bit, but here’s another breaking test to give you an idea of how it is occurring.

https://github.com/jaredgalanis/ember-changeset/commit/470a1558786a1a5df707926a5d4fd9f5b571dde9

I’m happy to take a swing at fixing it later, but given your understanding of the internals it may just be more efficient if you know where the fix is to let you handle it?

Thanks again for addressing this so quickly! 😃

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
rwwagner90commented, Oct 4, 2020

We could do workarounds like unwrap or accessing content directly, but I think this is quite a change from ember-changeset previously and not an intuitive experience. It’s easy to miss one, and it would be ideal if we could restore the old behavior, so it can be used just like a normal model in forms.

0reactions
snewcomercommented, Oct 3, 2020

not talking here about a further level of relationship nesting, it’s simply the relationship in the other direction

Yep that makes sense. I haven’t documented it well, but we have tons of tradeoffs since 2.0. Accessing nested data has never worked well. This recursive proxy solution fixes this as long as you access the leaf keys.

https://github.com/validated-changeset/validated-changeset/pull/45

In your case, do you have access to the belongsTo record before it gets passed to e-p-s? If so, can you try calling belongsTo.unwrap() where this property is read?

https://github.com/validated-changeset/validated-changeset/blob/70e918a80fc1149a09e1f922afb5de710a7ce3ad/src/index.ts#L979

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ember data BelongsTo relationships returns a proxy but it ...
Ember data BelongsTo relationships returns a proxy but it returns a different proxy even when all items belong to the same parent.
Read more >
Ember Data Proxy BelongsTo
I have 2 models. The parent has a hasMany relationship with the children. Each child has a belongsTo relationship with its parent.
Read more >
creates a manifest for an uploaded file group, and puts it in s3
List Relationships with the given relationship id · Returns the Relationship Instance that was created · Get a Relationship · Update a Relationship...
Read more >
Web service error codes (Microsoft Dataverse) - Power Apps
This topic lists the error codes you might encounter when you debug your code.
Read more >
RFC 3588: Diameter Base Protocol
In order to improve scalability, [PROXYCHAIN] introduced the concept of proxy ... Every Diameter accounting application specification MUST have an IANA ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found