mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-16 18:25:17 +02:00
better logging for mismatched toolkit auth ids
This commit is contained in:
parent
9a60a03217
commit
73e8f762bf
1 changed files with 17 additions and 2 deletions
|
|
@ -51,7 +51,23 @@ export class SyncConnectedAccountUseCase implements ISyncConnectedAccountUseCase
|
||||||
}
|
}
|
||||||
const account = project.composioConnectedAccounts?.[toolkitSlug];
|
const account = project.composioConnectedAccounts?.[toolkitSlug];
|
||||||
if (!account || account.id !== connectedAccountId) {
|
if (!account || account.id !== connectedAccountId) {
|
||||||
throw new Error(`Connected account ${connectedAccountId} not found in project ${projectId}`);
|
// Log detailed mismatch context to aid debugging
|
||||||
|
try {
|
||||||
|
// Avoid crashing on logging itself
|
||||||
|
// Include both expected and stored IDs, toolkit slug, and available toolkits
|
||||||
|
// so we can quickly spot wrong slug or race conditions.
|
||||||
|
// Note: This is server-side logging only.
|
||||||
|
console.error('[Composio] Connected account mismatch', {
|
||||||
|
projectId,
|
||||||
|
toolkitSlug,
|
||||||
|
expectedConnectedAccountId: connectedAccountId,
|
||||||
|
storedAccountId: account?.id ?? null,
|
||||||
|
storedStatus: account?.status ?? null,
|
||||||
|
availableToolkits: Object.keys(project.composioConnectedAccounts || {}),
|
||||||
|
});
|
||||||
|
} catch {}
|
||||||
|
|
||||||
|
throw new Error(`Connected account ${connectedAccountId} not found in project ${projectId} (toolkit: ${toolkitSlug})`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (account.status === 'ACTIVE') {
|
if (account.status === 'ACTIVE') {
|
||||||
|
|
@ -86,4 +102,3 @@ export class SyncConnectedAccountUseCase implements ISyncConnectedAccountUseCase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue