-
-
Notifications
You must be signed in to change notification settings - Fork 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
@ngrx/data - mergeServerUpserts - can't define property "originalValue": Object is not extensible #2374
Comments
Can't replicate on pure mergeServerUpserts unit tests. Starting to think this is related to the UPSERT_ONE in the set up of the |
@timdeschryver can I borrow your knowledge on immutability and check my thinking on this before submitting a PR? it concerns mergeServerUpserts https://github.com/ngrx/platform/blob/master/modules/data/src/reducers/entity-change-tracker-base.ts#L296 Is the reason this throws because in the
Should I include a tests along the following lines when submitting PR?
|
@AdditionAddict correct, because it has the same reference it will throw. (function()
{
'use strict';
let person = { id: 1, name: 'Alice' }
Object.freeze(person)
let arr = [person]
let p = arr[0]
p.name = 'boom'
}()); I think your proposed fix should resolve this. |
Minimal reproduction of the bug/regression with instructions:
Stackblitz - see
mergeServer()
Here after setup of initialState the state is
Expected behavior:
Would expect state to be the same (merge values are the same) with no errors
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
ngrx 8.6.0
Other information:
mergeServerUpserts in https://github.com/ngrx/platform/blob/master/modules/data/src/reducers/entity-change-tracker-base.ts#L296
I would be willing to submit a PR to fix this issue
[x ] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
The text was updated successfully, but these errors were encountered: