Refine subscription import and refresh flow
All checks were successful
Build and Deploy Gateway / build-and-push (push) Successful in 15s
Build and Deploy Gateway / deploy (push) Successful in 13s

This commit is contained in:
2026-07-12 11:18:33 +03:00
parent ba15a25c89
commit 005c7a101b
15 changed files with 190 additions and 218 deletions

View File

@@ -3,7 +3,6 @@ import http from 'node:http';
import test from 'node:test';
import {
createLatestRequest,
createOperationRegistry,
OPERATION_CONFLICTS,
operationBlocked,
@@ -72,22 +71,3 @@ test('a conflicting operation is rejected before its action starts', async () =>
connection.resolve(true);
await running;
});
test('latest request cancels and ignores a stale validation result', async () => {
const latest = createLatestRequest();
const oldResult = deferred();
const newResult = deferred();
let oldSignal;
const oldRequest = latest.run((signal) => {
oldSignal = signal;
return oldResult.promise;
});
const newRequest = latest.run(() => newResult.promise);
oldResult.resolve('old');
newResult.resolve('new');
assert.equal(await oldRequest, undefined);
assert.equal(await newRequest, 'new');
assert.equal(oldSignal.aborted, true);
});