Repository navigation
fix(reporting): name reporting_revision_id on the not-found answer for an unknown revision - #1796
Conversation
…r an unknown revision AdCP 3.3 makes a compacted snapshot's exact read answer the nondisclosing REFERENCE_NOT_FOUND with field "reporting_revision_id", "exactly as for an unknown ID". The SDK's unknown-revision answers carried no field. reporting_error gains a field parameter, and the store's REVISION_NOT_FOUND maps to REFERENCE_NOT_FOUND with field reporting_revision_id. LedgerConflictError gains an optional field, set at the exact-revision lookups in status, projection and the production get_media_buy_delivery path, and the admission translator and the handler's own mapping carry it to the wire. Other unresolved references keep no field. The message stays generic and nondisclosing. Refs #1669 Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve.
Clean, backward-compatible fix. Threads a keyword-only, optional field through the reporting error path so an unknown/retired revision answers REFERENCE_NOT_FOUND with field: "reporting_revision_id", matching the 3.2→3.3 migration shape. All new params are keyword-only and optional, so public-API/wire stability is preserved and the fix(reporting): prefix is correct (no breaking change). field is initialized before the try in get_media_buy_delivery so every path to _task_error has it defined; reporting_error preserves a passed field on REFERENCE_NOT_FOUND and keeps LOOKUP_UNAVAILABLE field-less. The value is a static field name, not a resolved value, so the answer stays nondisclosing. Tests cover both raise forms, the direct call, handler absent-revision, and the negative case.
No Critical/High/Medium findings. No gated paths, no high-risk flag, no author team gate. Falls through to row 9.
The last open item of #1669 that applies to 3.3.
The 3.2 to 3.3 migration guide (§Superseded reporting snapshots may be compacted) says a compacted snapshot's exact read returns the nondisclosing
REFERENCE_NOT_FOUNDwithfield: "reporting_revision_id", "exactly as for an unknown ID". The SDK's unknown-revision answer carried nofield, so it didn't match the shape compaction will reuse.Changes:
reporting_error: gains a keyword-onlyfield. The store-internalREVISION_NOT_FOUNDmaps toREFERENCE_NOT_FOUNDwithfield: "reporting_revision_id".LedgerConflictError: gains an optionalfield(backward compatible). It's set at the exact-revision lookups:ledger/status.py, the revision view;projection/wire.py;get_media_buy_deliveryexact-revision path, three sites.installed_reporting_call,_subscription_grantand the handler's own exact-revision mapping carry the field to the wire error.field. Messages stay generic and nondisclosing.This only adds a field to an error, so nothing breaks. It changes no ledger column or anything storage reads, and nothing under
packages/; the PostgreSQL store'sREVISION_NOT_FOUNDis mapped centrally.Tests:
tests/test_reporting_unreadable_revision_errors.pynow asserts the field:reporting_error;That file,
test_reporting_installed_errors.pyandtest_reporting_ledger.py: 171 passed. ruff and mypy are clean.Refs #1669
🤖 Generated with Claude Code