Skip to content

Commit 464958d

Browse files
Increase timeout for getCookies to 30 seconds (#3)
* Increase timeout for getCookies to 30 seconds Default timeout is 3000ms and I can't enter my password fast enough * fix(auth): patch sweet-cookie timeout and node22 sqlite handling * fix(ci): remove unsupported hashFiles call in job if * fix(ci): install ripgrep for security check job --------- Co-authored-by: Peggy Rayzis <peggyrayzis@gmail.com>
1 parent b47d8d1 commit 464958d

File tree

8 files changed

+68
-3
lines changed

8 files changed

+68
-3
lines changed

.github/workflows/docs-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,11 @@ jobs:
5050
cache: "pnpm"
5151

5252
- run: pnpm install --frozen-lockfile
53+
- run: sudo apt-get update && sudo apt-get install -y ripgrep
5354
- run: npm run security
5455

5556
smoke:
56-
if: ${{ hashFiles('scripts/smoke.sh') != '' && vars.LI_SMOKE_ENABLED == '1' }}
57+
if: ${{ vars.LI_SMOKE_ENABLED == '1' }}
5758
runs-on: ubuntu-latest
5859
continue-on-error: true
5960
steps:

docs/DECISIONS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Last Updated: 2026-02-25
33

44
| Date | Decision | Status | Rationale | Consequences | Supersedes |
55
| --- | --- | --- | --- | --- | --- |
6+
| 2026-02-25 | Temporarily patch `@steipete/sweet-cookie@0.1.0` in-repo | active | Upstream release does not yet include Chrome macOS timeout propagation and Node 22 Chrome sqlite overflow handling | `pnpm.patchedDependencies` now carries a local patch that must be removed once upstream releases fixes | n/a |
67
| 2026-02-25 | Adopt repository operating system with multi-agent roles and PR-first enforcement | active | Reduce process drift and make quality/security checks mechanically enforced | Adds standardized docs/scripts/hooks/templates and CI checks | n/a |
78
| 2026-02-25 | GitHub Issues become the only task tracker | active | Keep planning and delivery in one auditable system | No parallel `docs/TASKS.md` or duplicate trackers | informal task notes |
89
| 2026-02-25 | Managed docs moved to `docs/` and stale root markdown retired | active | Remove conflicting guidance and normalize discoverability | `CLAUDE.md`, root `SPEC.md`, and root `DECISIONS.md` are retired | root markdown process docs |

docs/MEMORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ Append-only log. Add entries; do not rewrite historical entries except typo fixe
1212
- Correction: repository mixed `.MD` and `.md` file extensions.
1313
- Fix: normalized markdown file extensions to `.md` and removed stale uppercase root docs.
1414
- Guardrail: future docs updates should only create `.md` files.
15+
16+
## 2026-02-25
17+
- Correction: `@steipete/sweet-cookie@0.1.0` ignored Chrome macOS `timeoutMs` and failed Chrome cookie reads on Node 22 with large `expires_utc` values.
18+
- Fix: applied a local `pnpm` dependency patch to propagate `timeoutMs` in Chrome macOS keychain reads and cast `expires_utc` for Node runtimes without `readBigInts`.
19+
- Guardrail: keep the repository patch until upstream `sweet-cookie` merges/releases equivalent fixes, then remove patch and retest smoke on Node 22.

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,10 @@
5757
"dotenv": "^17.2.3",
5858
"json5": "^2.2.3",
5959
"picocolors": "^1.1.1"
60+
},
61+
"pnpm": {
62+
"patchedDependencies": {
63+
"@steipete/sweet-cookie@0.1.0": "patches/@steipete__sweet-cookie@0.1.0.patch"
64+
}
6065
}
6166
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/dist/providers/chromeSqlite/shared.js b/dist/providers/chromeSqlite/shared.js
2+
index 59ef6e4e20a40a71db7fc39d46606c306682e967..cd1bd1690f6e7dc1819dcb1ec68279f1a54f3115 100644
3+
--- a/dist/providers/chromeSqlite/shared.js
4+
+++ b/dist/providers/chromeSqlite/shared.js
5+
@@ -185,7 +185,10 @@ async function readChromiumMetaVersion(dbPath) {
6+
async function readChromeRows(dbPath, where) {
7+
const sqliteKind = isBunRuntime() ? 'bun' : 'node';
8+
const sqliteLabel = sqliteKind === 'bun' ? 'bun:sqlite' : 'node:sqlite';
9+
- const sql = `SELECT name, value, host_key, path, expires_utc, samesite, encrypted_value, ` +
10+
+ const expiresCol = sqliteKind === 'node' && !supportsReadBigInts()
11+
+ ? 'CAST(expires_utc AS TEXT) AS expires_utc'
12+
+ : 'expires_utc';
13+
+ const sql = `SELECT name, value, host_key, path, ${expiresCol}, samesite, encrypted_value, ` +
14+
`is_secure AS is_secure, is_httponly AS is_httponly ` +
15+
`FROM cookies WHERE (${where}) ORDER BY expires_utc DESC;`;
16+
const result = await queryNodeOrBun({ kind: sqliteKind, dbPath, sql });
17+
diff --git a/dist/providers/chromeSqliteMac.d.ts b/dist/providers/chromeSqliteMac.d.ts
18+
index da0e8aaad456961d15185be1cc03b5f0bcd8d179..3a213b185ad4f36cf9f2a52b307d502510d5655f 100644
19+
--- a/dist/providers/chromeSqliteMac.d.ts
20+
+++ b/dist/providers/chromeSqliteMac.d.ts
21+
@@ -3,5 +3,6 @@ export declare function getCookiesFromChromeSqliteMac(options: {
22+
profile?: string;
23+
includeExpired?: boolean;
24+
debug?: boolean;
25+
+ timeoutMs?: number;
26+
}, origins: string[], allowlistNames: Set<string> | null): Promise<GetCookiesResult>;
27+
//# sourceMappingURL=chromeSqliteMac.d.ts.map
28+
diff --git a/dist/providers/chromeSqliteMac.js b/dist/providers/chromeSqliteMac.js
29+
index 71c815f77378d03e07061976ac372b3a55a61ac4..3a85a2fce102128d7e7b69145d97bc353f663008 100644
30+
--- a/dist/providers/chromeSqliteMac.js
31+
+++ b/dist/providers/chromeSqliteMac.js
32+
@@ -15,7 +15,7 @@ export async function getCookiesFromChromeSqliteMac(options, origins, allowlistN
33+
const passwordResult = await readKeychainGenericPasswordFirst({
34+
account: 'Chrome',
35+
services: ['Chrome Safe Storage'],
36+
- timeoutMs: 3_000,
37+
+ timeoutMs: options.timeoutMs ?? 3_000,
38+
label: 'Chrome Safe Storage',
39+
});
40+
if (!passwordResult.ok) {

pnpm-lock.yaml

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/auth.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ async function extractBrowserCookies(
9090
url: LINKEDIN_URL,
9191
browsers: browsers,
9292
profile: profileDir,
93+
timeoutMs: 30000,
9394
});
9495

9596
if (result.warnings) {

tests/unit/auth.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ describe("auth", () => {
204204
expect(result.credentials.liAt).toBe("chrome-li-at-token");
205205
expect(result.credentials.jsessionId).toBe("chrome-jsession-token");
206206
expect(result.credentials.source).toBe("chrome");
207+
expect(getCookies).toHaveBeenCalledWith(
208+
expect.objectContaining({
209+
browsers: ["chrome"],
210+
timeoutMs: 30000,
211+
url: "https://www.linkedin.com",
212+
}),
213+
);
207214
});
208215

209216
it("env vars take priority over Chrome cookies", async () => {

0 commit comments

Comments
 (0)