Skip to content

Canonical state representation #2

@hcschuetz

Description

@hcschuetz

Semantically equivalent states should be represented in the same way, no matter which way we reached the state. This is to avoid bugs due to subtle dependencies on the representation.

Examples:

  • If a group member has never been set, it is missing in the group's JSON object.
    After setting and retracting it, there is a member with value undefined.
    Retracting should actually remove the group member.
  • The same holds for a selection $detail.

Retractions need to be propagated upwards. For example, empty groups objects must be replaced with undefined.

Implementation note: Retractions are implemented as updateTo(undefined). To fulfill this ticket, many implementations of updateTo would have to treat an argument of undefined specially. Perhaps it is is a simpler/cleaner approach to have a specialized retract method in the context.

(Alternatively, we might use the representation with explicitly undefined components as the canonical representation. This would however require to "expand" state subtrees eagerly.)

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