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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] v3.20.6 introduces breaking change for @dependentKeyCompat #19262

Closed
fran-worley opened this issue Nov 12, 2020 · 10 comments
Closed

[Bug] v3.20.6 introduces breaking change for @dependentKeyCompat #19262

fran-worley opened this issue Nov 12, 2020 · 10 comments
Labels

Comments

@fran-worley
Copy link

馃悶 Describe the Bug

Updating from 3.20.5 results in the following error:

Assertion Failed: You attempted to use @dependentKeyCompat on a property that already has been decorated with either 
@computed or @tracked. @dependentKeyCompat is only necessary for native getters that are not decorated with 
@computed.

I suspect that this is being triggered from one of the third party addons we use as there are no cases where we use this decorator ourselves but the fact remains that patch updates of ember-source shouldn't introducing breaking changes and this one clearly does.

If you need more help reproducing this let me know and I can try and extract a little more info for you.

@fran-worley fran-worley changed the title [Bug] v3.20.6 introduces breaking change [Bug] v3.20.6 introduces breaking change for @dependentKeyCompat Nov 12, 2020
@rwjblue
Copy link
Member

rwjblue commented Nov 12, 2020

@fran-worley - Thanks for reporting! Sorry for the upgrade troubles here.

patch updates of ember-source shouldn't introducing breaking changes

I definitely agree that introducing a new assertion in a patch release is not great. I think from a usability perspective the only time it's "OK" to introduce new debug assertions like this is if it is telling you about something that is actually broken in your application code, that would have had downstream failures/errors already (but the error message would be misleading or useless).


Reading through the code (from #19138) I'm not quite sure if this falls into that same category though, as I think that if we remove the assertion things would still be operating correctly. Specifically:

let wrapGetterSetter = function(target: object, key: string, desc: PropertyDescriptor) {
let { get: originalGet } = desc;
assert(
'You attempted to use @dependentKeyCompat on a property that already has been decorated with either @computed or @tracked. @dependentKeyCompat is only necessary for native getters that are not decorated with @computed.',
descriptorForProperty(target, key) === undefined
);
if (originalGet !== undefined) {
desc.get = function() {
let propertyTag = tagFor(this, key) as UpdatableTag;
let ret;
let tag = track(() => {
ret = originalGet!.call(this);
});
updateTag(propertyTag, tag);
consumeTag(tag);
return ret;
};
}
return desc;
};

Is going to re-wrap the descriptors getter, which is definitely silly and a waste of time but not going to cause downstream failures / errors.

@pzuraq - Can you double check to confirm? If that is the case, then I'll remove the assertion from 3.20 / 3.22 series (leaving it in place for 3.23+) to ease the upgrade to 3.20.6+ for folks.

@pzuraq
Copy link
Contributor

pzuraq commented Nov 12, 2020

Yes, I think it should be fine to remove the assertion here, as you said it should just amount to doing a bit of extra work.

@rwjblue
Copy link
Member

rwjblue commented Nov 12, 2020

Submitted PR over in #19263.

@rwjblue rwjblue added the Bug label Nov 12, 2020
@locks
Copy link
Contributor

locks commented Nov 13, 2020

PR is merged but seems like Github didn't automatically close the issue. Thanks for the report @fran-worley and thanks for the quick turnaround from the team!

@locks locks closed this as completed Nov 13, 2020
@fran-worley
Copy link
Author

@locks sorry to bump, but this never actually got released... Given that v3.20 was LTS could we get a version bump? 馃ズ

@rwjblue
Copy link
Member

rwjblue commented Feb 15, 2021

Hmph, sorry I thought I had released it. Sorry about that! I'll try to get it done tomorrow morning. Reopening until we can confirm its released.

@rwjblue rwjblue reopened this Feb 15, 2021
@Techn1x
Copy link

Techn1x commented Apr 28, 2021

I think I hit this one today in my Ember 3.20.6 app. Updating to Ember 3.24.3 solved the problem.

Would be cool to see this backported to 3.20.7 if we can get that happening, would have saved me a bunch of time..

Friendly ping/reminder @rwjblue

@Techn1x
Copy link

Techn1x commented May 11, 2021

Well, we're outside of the 3.20.x LTS bugfix window now :/

Guess it's not getting backported. I don't mean to be a grouch but it kind of devalues the benefit of being on an LTS version if we don't get these bugfixes.

Onto Ember 3.24 we go... :)

@rwjblue
Copy link
Member

rwjblue commented Jun 3, 2021

I'll get this backported to 3.20 today, I'm working on another couple of fixes that are critical for some apps I work on.

Guess it's not getting backported. I don't mean to be a grouch but it kind of devalues the benefit of being on an LTS version if we don't get these bugfixes.

You are 100% correct. I'm really sorry for the delays.

@rwjblue
Copy link
Member

rwjblue commented Jun 3, 2021

I've just tagged and kicked off publishing of https://github.com/emberjs/ember.js/releases/tag/v3.20.7, it should be published to npm once https://travis-ci.org/github/emberjs/ember.js/builds/773433834 CI job is completed.

@locks locks closed this as completed Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants