Skip to content

[BUGFIX beta] Fix resetting of properties to in-flight values - #4379

Merged
bmac merged 1 commit into
warp-drive-data:masterfrom
courajs:reset-to-inflight-value
May 12, 2016
Merged

[BUGFIX beta] Fix resetting of properties to in-flight values#4379
bmac merged 1 commit into
warp-drive-data:masterfrom
courajs:reset-to-inflight-value

Conversation

@courajs

@courajs courajs commented May 10, 2016

Copy link
Copy Markdown
Contributor

Changing the value of an in-flight property, then changing back, had the
side effect that the record would be marked dirty once the save
completed.

changedAttributes would report that name had been changed from
'Thomas' to 'Thomas'

This is because the attr computed was only checking to see if the value
was being reset to the canonical value, not if it was being reset to the
in-flight value

@courajs

courajs commented May 10, 2016

Copy link
Copy Markdown
Contributor Author

Dug up while working on #4246

Comment thread tests/unit/model-test.js
assert.equal(person.get('name'), "Tomathy");

person.set('name', 'Thomas');
assert.equal(person.get('name'), "Thomas");

@courajs courajs May 10, 2016

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without these 4 lines 131-135, this test passed without code changes. Changing name, and then changing it back, put the record in a bad state.

Changing the value of an in-flight property, then changing back, had the
side effect that the record would be marked dirty once the save
completed.

`changedAttributes` would report that `name` had been changed from
'Thomas' to 'Thomas'

This is because the attr computed was only checking to see if the value
was being reset to the canonical value, not if it was being reset to the
in-flight value
@courajs
courajs force-pushed the reset-to-inflight-value branch from b729405 to 8046c48 Compare May 10, 2016 16:16
@bmac
bmac merged commit b9e28d4 into warp-drive-data:master May 12, 2016
@bmac

bmac commented May 12, 2016

Copy link
Copy Markdown
Contributor

Thanks @courajs.

@courajs
courajs deleted the reset-to-inflight-value branch May 12, 2016 13:35
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

Successfully merging this pull request may close these issues.

2 participants