Workshop index · Download all examples and lessons
The candidate increases availability before checking whether cancellation already happened. A second call returns false but still increases capacity to 13. Move that mutation below the guard.
For both languages, a meaningful regression test asserts: first cancellation returns true, second returns false, final availability is 10. TypeScript must await both calls. The misleading test does not run its assertions because its gate is never resolved and its promise chain is neither returned nor awaited.
The reference implementations are in python/store.py and typescript/store.ts. Author checks prove the candidate has the teaching defect and the reference implementation satisfies the repeated-cancellation contract.