Example to read aloud — not a recorded result
“"Look at apps slash web slash app slash api slash orders slash cancel-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 dot ts. 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."”
- · Illustrative practice text, not a recorded Halopen result.
- · Read a short section aloud, then check the inserted draft for errors.
- · Keep exact names, numbers and formatting under your own review.