Skip to content

Enforce validation and suspect flagging rules for StartTransaction events #1963

@juherr

Description

@juherr

1. Duplicate start on an already started session

If a StartTransaction is received for a transaction that is already started (i.e., an active session already exists with a recorded start):

  • The event must be marked as suspect.
  • It should not overwrite or alter the existing transaction state.

2. Start on a connector with an active or previous transaction conflict

If a StartTransaction is received while:

  • another transaction is currently active on the same connector, or
  • a previous transaction lifecycle on that connector is not yet properly closed or reconciled,

the event must be marked as suspect.

This prevents overlapping or inconsistent transaction lifecycles on the same port.

3. Temporal regression at station level

If a StartTransaction.timestamp is earlier than the last StartTransaction.timestamp received from the same station:

  • The event must be marked as suspect.

This detects clock drift, replayed messages, or out-of-order delivery at station level.

4. Start timestamp in the future

If a StartTransaction.timestamp is significantly in the future (beyond a configurable tolerance window):

  • The event must be marked as suspect.

This protects against incorrect station clocks and replay or manipulation scenarios.

5. Meter regression compared to last stop

If meterStart is smaller than the meterStop of the last completed transaction on the same connector:

  • The event must be marked as suspect.

This detects meter rollback, counter reset, or data corruption scenarios that would break billing continuity.

Related to #1296 and #1962

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