Skip to content

Missing originalValues for collection of primitive types #78

@mahish

Description

@mahish

Hi,
I wanted to discuss an issue I encountered while working with a collection of primitive types. In my case, when an entity has a DataProperty with dp.isScalar === false, the state of the entity correctly changes to "Modified" when the content of the collection has been changed. However, I haven't noticed any effect of this state change in the originalValues map, as described in the originalValues documentation or here

While investigating this issue, I came across this code snippet in the repository

if (!property.isScalar) {
throw new Error("Nonscalar data properties are readonly - items may be added or removed but the collection may not be changed.");
}

First, I'm not recieving this error in my application. Second, the error message is not 100% clear to me so I would like to confirm my understanding here. Does "items may be added or removed but the collection may not be changed" mean that I can change its content but Im not able to change the collection itself => the reference (memory location)?

  • if true, is the support for originalValues pending and waiting for implementation in case of collection of primitive types?
  • if false, is there no plan to support it at all and I should handle it in my application in whatever way I need to?

I would appreciate any clarification on this matter. Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions