Halopen output
“"Look at apps slash web slash app slash api slash orders slash route dot ts. The cancel handler currently does a database update and then publishes the OrderCancelled event after — which means if the publish step fails, the row reflects cancellation but downstream consumers never hear about it. Refactor it so the row update and the event publish run inside a single Postgres transaction, using the existing pgClient.transaction wrapper from lib slash db. Add a regression test in the existing route test file that mocks the event-publish to throw and asserts the database row stays in the prior state. Don't change the public API of the handler, and don't introduce a new abstraction for this — just inline the transaction wrap."”
- · Three constraints stacked in one breath, all preserved verbatim
- · File paths captured naturally without spelling
- · "Don't introduce a new abstraction" — preference preserved exactly
- · A typed version of this prompt would have been compressed to half the length