Fix deepFreeze#657
Conversation
| obj.hasOwnProperty(prop) && | ||
| obj[prop] !== null && | ||
| !['object', 'function'].includes(typeof obj[prop]) | ||
| // `synonyms` is apparently changed later on and cannot be deepFroozen |
There was a problem hiding this comment.
@Page-
In the get Proxy here:
pinejs/src/sbvr-api/permissions.ts
Line 983 in 6675183
| @@ -715,19 +715,18 @@ const onceGetter = <T, U extends keyof T>( | |||
| }; | |||
|
|
|||
| const deepFreezeExceptDefinition = (obj: AnyObject) => { | |||
There was a problem hiding this comment.
ExceptDefinition isn't accurate to what this is attempting to do
|
|
||
| const table = tables[`${resourceName}$bypass`]; | ||
|
|
||
| const permissionsTable = (tables[permissionResourceName] = { |
There was a problem hiding this comment.
If you don't assign to tables[permissionResourceName] then all these changes to permissionsTable are essentially noops?
6675183 to
8efc9f3
Compare
Actually deep freezing the `constrainedAbstractSqlModel` Change-type: patch Signed-off-by: Harald Fischer <harald@balena.io> Signed-off-by: fisehara <harald@balena.io>
8efc9f3 to
d285613
Compare
| // `synonyms` is changed later on in the constrainedAbstractSqlModel.symbols get proxy | ||
| // `tables` is changed later on in the constrainedAbstractSqlModel.tables get proxy | ||
| !['synonyms', 'tables'].includes(prop) && |
There was a problem hiding this comment.
Does the _.cloneDeep in
pinejs/src/sbvr-api/permissions.ts
Line 963 in 6675183
There was a problem hiding this comment.
@Page- from my understanding the constrainedAbstractSqlModel should be deep frozen after the deepClone was made.
The freezing part applies to the constrainedAbstractSqlModel and at runtime the Proxies manipulate the dee frozen Object by writing parts to it through the proxies.
So I don't see that the _.cloneDeep is part of the freeze, please correct me here!
Actually deep freezing the
constrainedAbstractSqlModelChange-type: patch