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

Created on 2 Jul 2018  路  10Comments  路  Source: emberjs/data

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

Most helpful comment

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

All 10 comments

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

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.

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

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

3.2.2 in the Twiddle, 3.1.3 in my app.

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

@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?

@barelyknown the bug exists on canary.

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 https://github.com/emberjs/data/pull/5466 which is only available in newer ember-data). Happy to help out if you can point in the right direction.

Closing in favor of coalescing on #5517

Was this page helpful?
0 / 5 - 0 ratings