Skip to content

OCPP follow-ups after stable: boot start limit (#1911) #1940

Open

Description

@frahlg

Follow-ups from the final review of #1911 (head 797f806) on 28 Oct 2026. None of them makes the PR worse than master or breaks the owner's fuse rule, so they wait until after stable.

ocpp: a 2.0.1 TransactionEvent does not cancel a pending start limit

Seen in the final review of #1911 at 797f806, merged locally with master 573d24f.

Setup: a two-EVSE 2.0.1 station after a Core restart. The station sends its own BootNotification. EVSE 2 then sends TransactionEvent Updated (charging, 7 kW), and after that EVSE 1 sends StatusNotification Available. EVSE 2 sends no status of its own.

What happens: Updated sets connected but not transactionID, and it leaves bootLimitPending set. The later Available clears connected and starts the settle timer. fireBootLimit then sends 0 A to EVSE 0, the whole station, and pauses the running car until FTW's next order. On master no profile goes out. This breaks the rule that a Core restart during Charge now never sends 0 A to a charger with a running transaction. It is not blocking because it needs a two-EVSE 2.0.1 home station that boots on reconnect and skips EVSE 2's status in the burst after the boot. A station that reports Occupied there cancels the limit, and #1911 tests that case.

Evidence: the review test TestReviewV201UpdatedOnEVSE2BeforeAvailableOnEVSE1 (go/internal/ocpp) fails with "got 1 profile(s), last 0 A; want none".

Fix: in handlerV201.OnTransactionEvent, for Started and Updated, clear s.bootLimitPending under h.mu, as 1.6 OnMeterValues already does through meterCancelsBootLimitLocked. Optionally do the same for a 2.0.1 MeterValues with power above zero.

Test idea: boot a 2.0.1 station, send TransactionEvent Updated on EVSE 2 with 7 kW, then StatusNotification Available on EVSE 1, wait past the settle time, and assert that no profile arrives.

ocpp: no committed test pins the fire-time car check in fireBootLimit

Seen in the final review of #1911 at 797f806, merged with master.

Mutation: change the fireBootLimit guard !h.managed[id] || s.connected || s.transactionID >= 0 to !h.managed[id]. Every committed test in ./internal/ocpp still passes. Only the uncommitted review test from the follow-up above fails. The reviewer's earlier TestReviewV201TransactionUpdateDuringWaitBlocksBootLimit covered this guard, but #1911 did not commit it.

A second mutation, which drops the transaction-id half of meterCancelsBootLimitLocked, also survives on the merge, because #1787's takeUpTransactionLocked sets transactionID from the same meter value. That redundancy is harmless, but neither half has a test of its own on master.

Test idea: commit a 2.0.1 test where EVSE 1 reports Available (the timer starts) and EVSE 2 then sends TransactionEvent Updated inside the wait. Assert that no profile arrives. With the guard removed, the test must fail.

siterig: no s7s result for #1911 after the fix for the Core-restart case

The last siterig/short runs that include #1911 ran on 964643e and failed s7s-restart-short-25A (~/siterig/results/20261027-232851-964643e9-short, ~/siterig-pr/results/20261028-003905-964643e9-short). Neither ~/siterig/results nor ~/siterig-pr/results on macmini has a run for 92104f5, e6fc34b, a814fb4 or 797f806. The PR's own CI shows no rig check.

In place of the rig, the review ran a closed-loop test with the simulator: the real Central System and sim-ocpp, for easee-charge-up, charge-amps-aura and defa-power. Charge now ran at 16 A, then Core stopped and a new Server started on the same ports. The charger reconnected with its car, its transaction and its limit, then booted and reported in five orders: status then meter, meter then status, meter only, a 1.5 s gap before the meter, and a 1.5 s gap before the status. In all 15 cases, with the real 1 s wait, no 0 A landed, and the limit stayed at 16 A.

To do: run siterig/short (s7s-25) on the first master or beta that contains #1911 and #1787 together, and attach the result directory to this issue. Test idea: add the closed-loop restart test (TestReviewCoreRestartDuringChargeNowNeverLandsZero, kept in the reviewer's scratchpad) to go/cmd/sim-ocpp/ocppcp so CI checks the s7s shape on every PR.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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