qbo_auth: после invalid_grant статус сохраняется (не откатывается), sync отвечает 409 reauth_needed; найдено ручным тестом M1
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -128,14 +128,20 @@ export class MemoryStore implements Store {
|
||||
return this.conns.get(env) ?? null;
|
||||
}
|
||||
async withLock<T>(env: Env, fn: (c: LockedConn) => Promise<T>) {
|
||||
return fn({
|
||||
get: () => this.conns.get(env) ?? null,
|
||||
save: async (c) => {
|
||||
this.conns.set(env, c);
|
||||
},
|
||||
remove: async () => {
|
||||
this.conns.delete(env);
|
||||
},
|
||||
});
|
||||
const before = new Map(this.conns);
|
||||
try {
|
||||
return await fn({
|
||||
get: () => this.conns.get(env) ?? null,
|
||||
save: async (c) => {
|
||||
this.conns.set(env, c);
|
||||
},
|
||||
remove: async () => {
|
||||
this.conns.delete(env);
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
this.conns = before; // как транзакция PgStore: при исключении изменения откатываются
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user