Skip to content

Commit f95da45

Browse files
nicklaslclaude
andauthored
fix(js): increase state fetch stall timeout to 1s (#293)
Co-authored-by: Claude Opus 4.6 <[email protected]>
1 parent 96cc6a0 commit f95da45

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openfeature-provider/js/src/ConfidenceServerProviderLocal.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe('state update scheduling', () => {
129129
expect(mockedWasmResolver.setResolverState).toHaveBeenCalledTimes(1);
130130
});
131131
it('retries state download with backoff and stall-timeout', async () => {
132-
let chunkDelay = 600;
132+
let chunkDelay = 1500;
133133
net.cdn.state.handler = req => {
134134
const body = new ReadableStream<Uint8Array>({
135135
async start(controller) {
@@ -142,10 +142,10 @@ describe('state update scheduling', () => {
142142
});
143143
return new Response(body);
144144
};
145-
// Decrease chunkDelay after 2.5s so next retry succeeds
145+
// Decrease chunkDelay after a few retries so next retry succeeds
146146
setTimeout(() => {
147147
chunkDelay = 100;
148-
}, 2500);
148+
}, 6000);
149149

150150
await advanceTimersUntil(provider.updateState());
151151
expect(net.cdn.state.calls).toBeGreaterThan(1);

openfeature-provider/js/src/ConfidenceServerProviderLocal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class ConfidenceServerProviderLocal implements Provider {
8181
baseInterval: 500,
8282
maxInterval: this.stateUpdateInterval,
8383
}),
84-
withStallTimeout(500),
84+
withStallTimeout(1 * TimeUnit.SECOND),
8585
],
8686
'https://resolver.confidence.dev/*': [
8787
withRouter({

0 commit comments

Comments
 (0)