🪻 distributed transcription service thistle.dunkirk.sh

fix: clear all rate limit data in test cleanup

The previous cleanup only deleted rate limit attempts with keys containing
'test' or 'admin', but IP-based rate limits have keys like 'register:ip:unknown'
which don't match this pattern. This caused rate limit tests to fail because
attempts accumulated across tests.

Now clearing all rate limit attempts between tests to ensure proper isolation.

Claude 6818baa4 9b310c90

Changed files
+3 -2
src
+3 -2
src/index.test.ts
···
db.run("DELETE FROM transcriptions WHERE user_id IN (SELECT id FROM users WHERE email LIKE 'test%' OR email LIKE 'admin@%')");
db.run("DELETE FROM users WHERE email LIKE 'test%' OR email LIKE 'admin@%'");
-
// Clear rate limit data (keys are formatted as "endpoint:type:identifier")
-
db.run("DELETE FROM rate_limit_attempts WHERE key LIKE '%test%' OR key LIKE '%admin%'");
+
// Clear ALL rate limit data to prevent accumulation across tests
+
// (IP-based rate limits don't contain test/admin in the key)
+
db.run("DELETE FROM rate_limit_attempts");
}
beforeEach(() => {