diff --git a/patches/@steipete__sweet-cookie.patch b/patches/@steipete__sweet-cookie.patch index 12ab8a5..bf1710d 100644 --- a/patches/@steipete__sweet-cookie.patch +++ b/patches/@steipete__sweet-cookie.patch @@ -74,3 +74,20 @@ index 71c815f77378d03e07061976ac372b3a55a61ac4..b21c15640955a8e7faa8f1d6ea6fed7c args.profile = profile; return resolveCookiesDbFromProfileOrRoots(args); } +diff --git a/dist/providers/chromeSqlite/shared.js b/dist/providers/chromeSqlite/shared.js +index 1234567890abcdef..fedcba0987654321 100644 +--- a/dist/providers/chromeSqlite/shared.js ++++ b/dist/providers/chromeSqlite/shared.js +@@ -185,9 +185,13 @@ async function readChromeRows(dbPath, where) { + const sqliteKind = isBunRuntime() ? 'bun' : 'node'; + const sqliteLabel = sqliteKind === 'bun' ? 'bun:sqlite' : 'node:sqlite'; +- const sql = `SELECT name, value, host_key, path, expires_utc, samesite, encrypted_value, ` + ++ // Cast expires_utc to TEXT to avoid integer overflow errors on Node < 24.4 ++ // where readBigInts option is not available. The code already handles string parsing. ++ const expiresCol = (sqliteKind === 'node' && !supportsReadBigInts()) ++ ? 'CAST(expires_utc AS TEXT) AS expires_utc' ++ : 'expires_utc'; ++ const sql = `SELECT name, value, host_key, path, ${expiresCol}, samesite, encrypted_value, ` + + `is_secure AS is_secure, is_httponly AS is_httponly ` + + `FROM cookies WHERE (${where}) ORDER BY expires_utc DESC;`; + const result = await queryNodeOrBun({ kind: sqliteKind, dbPath, sql });