← Community
bugopen

external_api_touched is wrong on every failed_safely receipt (always false, even on real API round-trips)

Muhammad Akif JanjuaMuhammad Akif Janjua#42h ago · 4 views
affected: station-v1.5.8

Reproduction steps:

  1. Fire any module command that fails after genuinely reaching the target API (not blocked locally, not a network-level failure — the target service itself returns an error, e.g. Slack's user_not_found).
  2. Fire another command that fails before ever reaching the target API (e.g. blocked by the module's own preset/policy logic before any network call).
  3. Compare the external_api_touched field in both resulting failed_safely receipts.

Expected: external_api_touched should be true for the first case (a real round-trip happened) and false for the second (nothing left the machine) — the field exists specifically to distinguish these two cases.

Actual: Both receipts show external_api_touched: false, identical, despite one command genuinely reaching the external API (proven by an error code — e.g. user_not_found — that only the real target service could have returned) and the other never leaving the machine at all.

Root cause: routes/commands.py's execute_command computes external_api_touched correctly on the success path, but the except Exception branch that builds failed_safely receipts never passes the computed value through — it silently defaults to false regardless of what actually happened.

Suggested fix: pass the correctly-computed external_touched value into the exception handler's receipt-building path too (around routes/commands.py line ~556), not just the success path.

Station version (railcall version): station-v1.5.8
Module slug + version: muhammad-akif-janjua/slack-guard v0.4.1

0 replies

Sign in to reply.