Skip to content

fix: treat empty-horizon cancel as processed - #8

Open
donalffons wants to merge 1 commit into
masterfrom
fix/empty-horizon-cancel
Open

donalffons wants to merge 1 commit into
masterfrom
fix/empty-horizon-cancel

Conversation

@donalffons

Copy link
Copy Markdown
Member

Purpose

A canceled order with leftover mapped actions never reached onOrderProcessed. After merge, an empty node/edge horizon counts as processed so Blink can confirm cancel and retry.

Design & Architecture Decisions

  • If the order is already latched canceled and the AGV reports no remaining nodes or edges, treat it as processed even when mapped actions are still in the library cache.
  • Keep scanning every in-flight cancelOrder instant action instead of returning on the first mismatch, so a retry's new cancel is still observed.

Business Logic, Decision Tree, Data Flow

flowchart LR
  State[AGV state] --> Canceled{cache.canceled and empty horizon?}
  Canceled -->|yes| Processed([onOrderProcessed byCancelation])
  Canceled -->|no| Library[_isOrderProcessed]
  Library --> Done{Processed?}
  Done -->|yes| Processed
  Done -->|still active| Wait([Wait next state])
Loading

Structure & Composition

File Lines Notes
src/controller/master-controller.ts +8/−6 Empty-horizon processed; scan all cancelOrder actions
src/test/master-controller-cancellation-pending.test.ts +158 Covers leftover mapped actions and a later cancelOrder

Assumptions & Decisions

  • An empty horizon is enough to call a latched cancel terminal. Leftover mapped actions do not keep the order active.
  • Blink #376 depends on this SHA for checkout and for cancel confirmation during failed-action retry.

Test Coverage

  • New unit test: cancel with leftover mapped actions still emits processed-by-cancellation; a later cancelOrder is still seen.
  • Existing cancellation-latch tests remain the regression check for byCancelation across frames.

PR Stack

N/A — standalone library PR. Blink #376 consumes this commit as a submodule pointer.

Reviewer TODO

  • Confirm leftover mapped actions must not block a canceled empty-horizon order.
  • Confirm scanning every cancelOrder is required when retries publish a second cancel.

A canceled order can still have leftover mapped actions. Treat an empty
node/edge horizon as processed and keep scanning cancelOrder while
retries are in flight.
@donalffons donalffons self-assigned this Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant