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

[3.2.0+] Problem setting belongsto relationship (only works the 2nd time) #5511

Closed
urbany opened this issue Jul 2, 2018 · 10 comments
Closed

Comments

@urbany
Copy link

urbany commented Jul 2, 2018

Hi, weird bug I found while upgrading from v3.2.0-beta.4 to v3.2.0 (also happens on v3.3.0-beta.1)

I have a model appointment which belongsTo a model service.
When I create the appointment and then set the relationship service it does not work, it stays null.
It only happens with the relationship to the model named service, the other models work correctly, I tried to create a twiddle but I couldn't make it use latest ED, so here is a repro: https://github.com/urbany/ember-data-service-belongsto-bug

Try the buttons. The relationships to the model Service only get set when you set them twice

@urbany
Copy link
Author

urbany commented Jul 2, 2018

actually according to this it is not exclusive to models named service:
https://embercommunity.slack.com/archives/C045BQ4P7/p1530380754000078

@nickschot
Copy link

nickschot commented Jul 2, 2018

Accompanying Twiddle for the more generic issue: https://ember-twiddle.com/c59e7224470597d5df7189c666762a9f

If you click one of the buttons, nothing happens (you can keep clicking the same button). If you then click the other button the relationship is actually set. Now the button you first clicked also works.

@urbany urbany changed the title [3.2.0+] Problem with relationship of model named "service" [3.2.0+] Problem setting belongsto relationship (only works the 2nd time) Jul 2, 2018
@barelyknown
Copy link

We started to notice this issue 1-2 weeks ago on canary, but haven't tracked down the commit in which it was introduced.

@runspired
Copy link
Contributor

@barelyknown @urbany @nickschot what version of ember is paired with ember-data here?

@nickschot
Copy link

3.2.2 in the Twiddle, 3.1.3 in my app.

@runspired
Copy link
Contributor

I was able to track it down to the proxy not being refreshed on set, will fix. Thanks!

@barelyknown
Copy link

@runspired That's great. I noticed that it does not seem to be a problem on 3.3.0-canary. Has it already been fixed there?

@runspired
Copy link
Contributor

@barelyknown the bug exists on canary.

@john-griffin
Copy link

Any updates on this one? This has blocked our apps from upgrading data to 3.2 and is now blocking us from upgrading to ember 3.3 (as it also requires this fix #5466 which is only available in newer ember-data). Happy to help out if you can point in the right direction.

@runspired
Copy link
Contributor

Closing in favor of coalescing on #5517

runspired added a commit that referenced this issue Jul 23, 2018
)

* adds failing tests for #5511 and #5517

* add a test for #5525 that suspiciously passes

* adds test for #5522 isEmpty issue

* run prettier

* fix issue with proxy

* upgrade test for potential issue with create, still passes

* fix emberobserver issue for missing data member in payloads
NullVoxPopuli pushed a commit to NullVoxPopuli/data that referenced this issue Sep 8, 2018
…berjs#5533)

* adds failing tests for emberjs#5511 and emberjs#5517

* add a test for emberjs#5525 that suspiciously passes

* adds test for emberjs#5522 isEmpty issue

* run prettier

* fix issue with proxy

* upgrade test for potential issue with create, still passes

* fix emberobserver issue for missing data member in payloads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants