* fix: make cooldown_action decorator properly await async finish() The decorator was incorrectly wrapping the async finish() method with a sync wrapper, causing cooldown to be recorded BEFORE the action actually executed. This fix: - Changes wrapper to async def finish() - Awaits original_finish() before recording cooldown - Ensures cooldown is only recorded on successful execution Fixes #74 * test: add test to verify cooldown not recorded on failure This test actually reveals the async/await bug: - Creates a FailingAction that raises in finish() - Verifies cooldown is NOT recorded when action fails - Fails with buggy sync wrapper, passes with async fix
4.4 KiB
4.4 KiB