-
Notifications
You must be signed in to change notification settings - Fork 422
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
Attributes/Converters Issue #174
Comments
@imjoshdean That commit seems to be related to several bugs reported (namely #207 and #208). It would be great if we can figure out how this is supposed to work or fix it for 1.1.4. |
Man this is a tough nut. I narrowed it down to |
Tested this against latest locally and its no longer breaking. Tomorrow we'll push out a new 1.1.4 release candidate at http://canjs.us/release/latest/can.jquery.js (this isn't currently actually pushing out every night automated) and this should confirm this issue is fixed. |
Actually nevermind what I said above, forgot I had made a local change. Actually these lines in observe.js cause this weird behavior:
__convert is called twice per nested observe, once here and once a few lines down at self._set(prop, newVal). I'm not sure why this was necessary. f9896d9 introduced this line. Commenting these lines out fixes this issue and all other can tests still pass. Will talk to @imjoshdean about this tomorrow and get a test in. |
Closed via #266. |
Using the attributes plugin, I have an attribute of a model that is another type of model. And then an attribute of that second model uses a converter to determine its value.
In my app, it polls the server for fresh data and uses live binding to update the data in view. I noticed that a value that is determined using a converter is wrong after the first go round. It actually seems to be calling the converter twice. The first time with the correct value from the server, and the second time with the converted value. The second (incorrect) value is what is being used.
Please see the following fiddle. To simulate polling, just double click the output frame.
http://jsfiddle.net/thecountofzero/qYdwR/562/
Looking at commits, it seems that the issue was introduced with this commit:
f9896d9
The text was updated successfully, but these errors were encountered: