qbo_auth: после invalid_grant статус сохраняется (не откатывается), sync отвечает 409 reauth_needed; найдено ручным тестом M1
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { SPECS, type EntitySpec, type Row } from "./mirror.js";
|
||||
import { QboApi } from "./api.js";
|
||||
import { ReauthNeeded } from "./service.js";
|
||||
import type { FetchFn } from "./oauth.js";
|
||||
|
||||
export interface Q {
|
||||
@@ -179,6 +180,7 @@ export class QboSync {
|
||||
} catch (e) {
|
||||
const error = String((e as Error).message ?? e).slice(0, 500);
|
||||
if (runId) await this.d.query("update qbo_sync_run set status = 'error', finished_at = now(), counts = $2, error = $3 where id = $1", [runId, JSON.stringify(counts), error]).catch(() => undefined);
|
||||
if (e instanceof ReauthNeeded) throw e; // вызывающий (HTTP) отвечает 409 reauth_needed
|
||||
return { runId, realmId, status: "error", counts, error, durationMs: Date.now() - started };
|
||||
} finally {
|
||||
this.running = false;
|
||||
|
||||
Reference in New Issue
Block a user