Member Junction
    Preparing search index...

    The immutable-version guard shared by the unit, protocol and snapshot subclasses: one implementation of "a saved version is never updated", so the three entities cannot drift apart. It holds on both write paths: an ordinary save is refused in Validate() (AddProblems), and a ReplayOnly save, which skips Validate(), in Save() (SaveRefusingSavedRowReplay). A delete is not refused: the integration rigs and the plan's probes delete the rows they create, and the foreign keys keep a version that anything references.

    Which user. The unit, protocol and pipeline subclasses judge authorship and read other rows as ActiveUser: the user the save is attributed to (ContextCurrentUser, else the provider's CurrentUser), which BaseEntity.Save() checks permissions for and hands the provider's write. The coding standard's "use BaseEntity.ContextCurrentUser rather than tracking the current user" is about not keeping a user of one's own; ActiveUser is that same BaseEntity resolution, finished. ContextCurrentUser alone is only an explicitly set user: an entity created without one is written as the provider's user, and reading ContextCurrentUser would judge, and read as, no user instead.

    Index

    Constructors

    Methods

    • A version-1 row is its own lineage root: on create the server assigns LineageRootID = ID, because a client cannot choose the ID it will be given. Any other row is left as it is.

      Parameters

      • row: { ID: string; IsSaved: boolean; LineageRootID: string; Version: number }

      Returns void

    • The refusal for a write to a saved row; null for a new row or a saved row with no change. A row of a versioned lineage (it has a LineageRootID) is told to save the next version; a row with no lineage (a Training Snapshot) to write a new row. Pure.

      Parameters

      • entityName: string
      • isSaved: boolean
      • dirtyFields: readonly string[]
      • hasLineage: boolean

      Returns string

    • Runs save (the subclass's base save) unless this is a ReplayOnly save of a saved row, which is refused with GetReplayOnlyUpdateProblem recorded on the result history (so LatestResult.CompleteMessage carries it). ReplayOnly skips Validate() but still writes, and it writes even when no field is dirty (values loaded with LoadFromData are not dirty), so the option itself is refused on a saved row rather than its dirty fields judged. A ReplayOnly insert goes through, as it does for every entity.

      Parameters

      Returns Promise<boolean>