fix: add error logging to applier, session polling, and job card clicks

- job_applier.mjs: stack traces on per-job and browser-level errors
- session.mjs: log pending status and poll count during session refresh
- linkedin.mjs: log warning when job card click fails instead of silent catch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 17:30:24 -08:00
parent ed908c91af
commit 1bf676bb80
3 changed files with 10 additions and 3 deletions

View File

@@ -25,16 +25,19 @@ export async function refreshSession(platform, apiKey, connectionIds = {}) {
}
// If not immediately successful, poll for up to 30s
console.log(`${platform} session pending (status: ${loginResp.status}), polling...`);
const start = Date.now();
let pollCount = 0;
while (Date.now() - start < 30000) {
await new Promise(r => setTimeout(r, 2000));
pollCount++;
const conn = await kernel.auth.connections.retrieve(connectionId);
if (conn.status === 'SUCCESS') {
console.log(`${platform} session refreshed`);
console.log(`${platform} session refreshed (after ${pollCount} polls)`);
return true;
}
if (['FAILED', 'EXPIRED', 'CANCELED'].includes(conn.status)) {
console.warn(` ⚠️ ${platform} session refresh failed: ${conn.status}`);
console.warn(` ⚠️ ${platform} session refresh failed: ${conn.status} (after ${pollCount} polls)`);
return false;
}
}