-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[REGRESSION] In 1.13.2 {{#each}}
fails with duplicate values
#11549
Comments
Seems like a duplicate |
#11525 added a 'useful' error (the error previously was super obtuse if you take a look at the same JSBin for 1.13.1). It does not fix the issue with duplicates in general. In theory we could continue to add prefixes (like the index and/or a guid) to the key until we get a unique value (therefore avoiding a collision), but that feels like a kludge to me. I could easily submit a PR for this if others think it would be useful in 1.13.x. The proper path forward is understood by @krisselden and @wycats but it is not completely clear to me. |
Duplicate values in a list is common enough to require a |
@seanpdoyle - I am unsure, this is the first issue for it 😺. Also, my "fix" is mostly a hack (just continue fiddling with the |
@rwjblue I tried to get a failing test before submitting this issue, but I couldn't. Which test would good to copy and alter? I've looked in |
Failing tests are here: ember.js/packages/ember-htmlbars/tests/helpers/each_test.js Lines 1305 to 1337 in 6130fa6
Those tests should both be changed from |
I'm encountering this as well during 1.11 to 1.13 migration. Just to be sure, is using |
@stefanpenner this is preventing me from updating from 1.12.1 to 1.13.5. I'm getting the same error |
@pixelhandler does the advice in the error help you? |
I believe the plan to make this transparent may or may not be backported, as it has not yet been implemented. @krisselden or @mmun can likely speak more clearly. |
I tried it but still had the same error. I tried in my smallest app, so maybe need to do that everwhere in my core library and all 3rd party code too. Seems like the deprecation caused a breaking error |
That isn't a deprecation
can you share this repo? or demonstrate in a jsbin. Im sure whoever looks at this would be interested in seeing. |
@stefanpenner so API change to |
@pixelhandler the plan is to make it transparent with binning like in a hash map collision |
This should be made transparent for the 1.13.x, as it is clearly a breaking change. |
The error suggests using the following in the case of a duplicate: {{#each things key="@index"}}
{{! your stuff here }}
{{/each}} |
@rwjblue so confirm, a breaking change in 1.13.x, must NOT use duplicates when iterating over an array using Can that be added to the blog post as a breaking change (we broke your apps, lol) ? http://emberjs.com/blog/2015/06/12/ember-1-13-0-released.html |
@pixelhandler - Feel free to PR an update to the blog post, I would love to get this fixed for real in a point release of 1.13, but I do not have the expertise required to fix it. |
@pixelhandler IMHO this is a bug. Its just time consuming to fix, I hope @wycats or someone has time fix. It might be worth calling out, as a known bug, the will hopefully be fixed. |
@krisselden @rwjblue @stefanpenner - To handle the error why not just create a unique id on the fly? @stefanpenner no the company I work for values privacy, can't share the app. That's why I tinker with my blog project so I do have code to share. In that project I was able to add the |
a reproduction does not need to be a full app, a JSBIN or isolated repo would be best. I honestly don't want to sift through someones app unless it has to be. |
To me it seems better to generate a unique id on the fly instead of throwing an error, maybe it's the inline compiler I don't know. Prolly the best use of time is to deal with the error and try to use the key everywhere. |
this isn't related to the compiler. It is a runtime concern, the list-dffing takes into account some key to identify how the list changes over time. |
@stefanpenner @rwjblue I knew our apps would find a regression. how much test coverage does ember have? |
11,000 tests I believe this was a known regression, I'm not sure why it was deemed tolerable, but that choice wasn't made by me. |
@pixelhandler the generated id may collide with a future key, if based on the dup, may collide with a future key. |
From #11549 (comment) (above):
|
@pixelhandler there already is a failing example, the provided JSBIN offers it. Everyone is aware of this issue, solving it is just a function of available time. |
@stefanpenner I offer my Friday all day @rwjblue and you can tell me what do fix do, etc. I have time. I think the question is of priority not time, we all have the same 24 hrs. |
@pixelhandler #11549 (comment) It's worth noting, this issue is already well known, and well fleshed out. Beating on it isn't going to make it happen any faster. Please note, It is very important that unreported issues are reported. For existing issues, it is valuable to add missing information, to ensure the issue is fully formed. Additionally commentary provides diminishing returns. Not to offend, but if the problem solution was "just tell me what to do" easy, I suspect @rwjblue would have landed it 22 days ago. He is a machine after-all. You may consider exploring some of the suggestions kris gave, and seeing if you can apply them yourself. |
@pixelhandler you seem very motivated capably and eager to help, lets plan for a hangout friday morning. I would love to harness some of your availability and time. |
Could #11856 work for this? |
@stefanpenner just spoke with @mmun in slack he mentioned maybe looking into tonight. |
@raytiley that looks similar to a bucketing approach @krisselden was talking about. We should get him to weigh in, to be sure this exact approach is what he was thinking about. Or if it was more elaborate. (or different entirely) It would be lovely if the adjustment was that. |
@stefanpenner sounds good, I'll send you an invite for Fri morning. I like taking larger blocks of time for offering help. During the week I have football with the kids meetings with teams at work, Meetup w/ Ember at night, a wife, 5 kids and 94 yr old grandpa at the house so I understand juggling priority. Ember.js is my 1st priority on Friday, all day (unless we have a server burnt with fire at work). |
Understood, i'll be mindful of that. I suspect once everyone motivations/costs/availiabity is hashed out we can work in harmony. Smooth out these few upgrade pains and make the world a better place. And on saturdays we can go surfing |
@stefanpenner my suggestion though is to do it inside yieldItem, in the current map use binning, this is duplicating already a seen that is also inside yieldItem. |
@stefanpenner for us we tried the work around with |
@stefanpenner yeah it wasn't a deprecation is was a warning but that was removed here https://github.com/emberjs/ember.js/releases/tag/v1.13.2 https://github.com/emberjs/ember.js/pull/11461/files |
Those are unrelated concerns. The warning in versions prior to 1.13.2 was for when no key was specified. During 1.13.0/1 you would have received a very hairy error message from deep inside htmlbars. The error that instructs you how to recover was added in 1.13.3 (from #11525) and is intended as a stop gap measure to provide at least a small amount of insight into the cause of the error that was happening in 1.13.0/1/2. |
Wooohoo. The magic of @mmun |
@rwjblue, @stefanpenner @mmun - Thanks for fixing the regression! So will this be in a patch release (v1.13.6) soon? |
Yes, it will be in the next patch release. "soon" is relative though 👯 |
@rwjblue just curious for those of us with broken apps and blocked from upgrading to 1.13.x why wait for a patch? What's the workaround use master branch? or just wait? |
@pixelhandler building ember is documented here: https://github.com/emberjs/ember.js/#building-emberjs. I am unsure if @rwjblue has had a chance to backport the fix to the stable branch (which is 1.13.x) but if he has you can likely just build stable. In theory, builds.emberjs.com has every commit built and published, but currently it can be tricky to find the version you want. (would be nice if someone could help here) |
@stefanpenner if it was backported to stable, it would be published to the release channel http://emberjs.com/builds/#/release |
ah, even unreleased but merely backported commits, Correct? |
@rwjblue I’m curious… the release version of ember on the website has What does that mean? Is there non-patch release code in the release? So, I guess since this issue blocks me from upgrading to 1.13.5 I need to build from source? and manage my own fork (if there is something in the future that is back ported)? Can someone tell me when I can expect an official release on the 1.13.x series that has this regression patched? I'm really happy it's fixed but extremely bummed that it's not released. Am I missing something? I guess I was under the impression that a patch release was warranted from this regression (breaking 1.x) in 1.13 |
TL;DR you fix should be in the list of files bellow, as they are on the way to becoming 1.13.6 |
Every commit to The builds page (as you discovered) shows the asset paths for these, feel free to use them (they are quite literally what will become the next tagged version). The release channel builds are generally always more up to date than the last tag.
Nope. The builds that you have already discovered include the patch you want. Feel free to use them 😉.
Ember 1.13.6 will be the version that includes this regression fix. It will be released when it is done.
It is available to use via the channel that you have already checked! |
We may have a UX issue here on the builds place (i was also confused), if someone is interested in pursuing it likely a discussion on the website repo is appropriate. |
@rwjblue ah that makes sense now our team did need clarity on…
Thanks we'll get started with the latest 'release' channel update. :) |
awesome, keep us posted! |
http://emberjs.jsbin.com/hedunosumi/edit?html,js,console,output
Might be a duplicate of #11504
has #11525 landed in
1.13.2
yet?The text was updated successfully, but these errors were encountered: