mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-07 22:44:06 +00:00
test(metering): find the actor key in any meterIncr argument
The buffered write now passes the claim key too, which moves the counter key's position. The image provider's write-ordering test matched it by index and stopped seeing the write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d2cef27085
commit
63a98f89ff
1 file changed
+2
-1
@@ -253,7 +253,8 @@ describe('OpenAiImageProvider.generate credit gate', () => {
|
||||
});
|
||||
let blocked = false;
|
||||
vi.spyOn(redis, 'meterIncr').mockImplementation(async (...args) => {
|
||||
if (!blocked && args[5].includes(`:actor:${actor.user!.uuid}:`)) {
|
||||
const actorKey = `:actor:${actor.user!.uuid}:`;
|
||||
if (!blocked && args.some((arg) => arg.includes(actorKey))) {
|
||||
blocked = true;
|
||||
await held;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user