@govtechsg/oobee 0.10.96 → 0.10.97

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -977,6 +977,13 @@ export const getPreLaunchHook = (userDataDirectory) => {
977
977
  // For pool re-launches, best-effort clone profile data from base directory
978
978
  // so authenticated sessions are preserved across browser pool retirements.
979
979
  if (launchCount > 1) {
980
+ const skipDirs = new Set([
981
+ 'Singleton', 'lockfile', 'LOCK',
982
+ 'Cache', 'Code Cache', 'GPUCache', 'DawnGraphiteCache', 'DawnWebGPUCache',
983
+ 'Service Worker', 'ScriptCache', 'ShaderCache', 'GrShaderCache',
984
+ 'component_crx_cache', 'optimization_guide_model_store',
985
+ 'BrowserMetrics', 'Crashpad', 'FileTypePolicies',
986
+ ]);
980
987
  try {
981
988
  const copyRecursive = async (src, dest) => {
982
989
  const stat = await fsp.stat(src).catch(() => null);
@@ -986,7 +993,7 @@ export const getPreLaunchHook = (userDataDirectory) => {
986
993
  await fsp.mkdir(dest, { recursive: true }).catch(() => { });
987
994
  const entries = await fsp.readdir(src).catch(() => []);
988
995
  await Promise.all(entries
989
- .filter(entry => !entry.startsWith('Singleton') && entry !== 'lockfile' && entry !== 'LOCK')
996
+ .filter(entry => !entry.startsWith('Singleton') && !skipDirs.has(entry))
990
997
  .map(entry => copyRecursive(path.join(src, entry), path.join(dest, entry)).catch(() => { })));
991
998
  }
992
999
  else {
package/dist/utils.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import path from 'path';
2
2
  import os from 'os';
3
3
  import fs from 'fs-extra';
4
+ import { globSync } from 'glob';
4
5
  import axe from 'axe-core';
5
6
  import { v4 as uuidv4 } from 'uuid';
6
7
  import { getDomain } from 'tldts';
@@ -338,13 +339,24 @@ export const cleanUp = async (randomToken, isError = false) => {
338
339
  if (randomToken === undefined && constants.randomToken) {
339
340
  randomToken = constants.randomToken;
340
341
  }
341
- if (constants.userDataDirectory)
342
+ if (constants.userDataDirectory) {
342
343
  try {
343
344
  fs.rmSync(constants.userDataDirectory, { recursive: true, force: true });
344
345
  }
345
346
  catch (error) {
346
347
  consoleLogger.warn(`Unable to force remove userDataDirectory: ${error.message}`);
347
348
  }
349
+ // Also remove _pool* sibling directories created by browser pool re-launches
350
+ try {
351
+ const poolDirs = globSync(`${constants.userDataDirectory}_pool*`);
352
+ for (const dir of poolDirs) {
353
+ fs.rmSync(dir, { recursive: true, force: true });
354
+ }
355
+ }
356
+ catch (error) {
357
+ consoleLogger.warn(`Unable to remove pool directories: ${error.message}`);
358
+ }
359
+ }
348
360
  if (process.env.TMPDIR && fs.existsSync('/.dockerenv'))
349
361
  try {
350
362
  fs.rmSync(process.env.TMPDIR, { recursive: true, force: true });
@@ -3,7 +3,7 @@
3
3
  * DO NOT EDIT MANUALLY. Re-generate with: node dist/generateOobeeClientScanner.js
4
4
  *
5
5
  * Embedded at generation time:
6
- * App version : 0.10.96
6
+ * App version : 0.10.97
7
7
  * Sentry DSN : (from OOBEE_SENTRY_DSN env var or constants.ts default)
8
8
  * Sentry SDK : @sentry/browser 10.58.0 (loaded from CDN at runtime)
9
9
  *
@@ -34883,7 +34883,7 @@
34883
34883
  // ── Sentry browser telemetry (Sentry JS SDK, loaded from CDN) ────────────
34884
34884
 
34885
34885
  var _oobeeSentryDsn = "https://3b8c7ee46b06f33815a1301b6713ebc3@o4509047624761344.ingest.us.sentry.io/4509327783559168";
34886
- var _oobeeAppVersion = "0.10.96";
34886
+ var _oobeeAppVersion = "0.10.97";
34887
34887
  var _oobeeSentryVersion = "10.58.0";
34888
34888
  var _oobeeSentryInitialized = false;
34889
34889
  var _oobeeSentryLoadPromise = null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@govtechsg/oobee",
3
3
  "main": "dist/npmIndex.js",
4
- "version": "0.10.96",
4
+ "version": "0.10.97",
5
5
  "type": "module",
6
6
  "author": "Government Technology Agency <info@tech.gov.sg>",
7
7
  "bin": {
@@ -1233,6 +1233,13 @@ export const getPreLaunchHook = (userDataDirectory: string) => {
1233
1233
  // For pool re-launches, best-effort clone profile data from base directory
1234
1234
  // so authenticated sessions are preserved across browser pool retirements.
1235
1235
  if (launchCount > 1) {
1236
+ const skipDirs = new Set([
1237
+ 'Singleton', 'lockfile', 'LOCK',
1238
+ 'Cache', 'Code Cache', 'GPUCache', 'DawnGraphiteCache', 'DawnWebGPUCache',
1239
+ 'Service Worker', 'ScriptCache', 'ShaderCache', 'GrShaderCache',
1240
+ 'component_crx_cache', 'optimization_guide_model_store',
1241
+ 'BrowserMetrics', 'Crashpad', 'FileTypePolicies',
1242
+ ]);
1236
1243
  try {
1237
1244
  const copyRecursive = async (src: string, dest: string) => {
1238
1245
  const stat = await fsp.stat(src).catch(() => null);
@@ -1242,7 +1249,7 @@ export const getPreLaunchHook = (userDataDirectory: string) => {
1242
1249
  const entries = await fsp.readdir(src).catch(() => []);
1243
1250
  await Promise.all(
1244
1251
  entries
1245
- .filter(entry => !entry.startsWith('Singleton') && entry !== 'lockfile' && entry !== 'LOCK')
1252
+ .filter(entry => !entry.startsWith('Singleton') && !skipDirs.has(entry))
1246
1253
  .map(entry =>
1247
1254
  copyRecursive(path.join(src, entry), path.join(dest, entry)).catch(() => {}),
1248
1255
  ),
package/src/utils.ts CHANGED
@@ -2,6 +2,7 @@ import { execSync, spawnSync } from 'child_process';
2
2
  import path from 'path';
3
3
  import os from 'os';
4
4
  import fs from 'fs-extra';
5
+ import { globSync } from 'glob';
5
6
  import axe, { Rule } from 'axe-core';
6
7
  import { v4 as uuidv4 } from 'uuid';
7
8
  import { getDomain } from 'tldts';
@@ -382,10 +383,22 @@ export const cleanUp = async (randomToken?: string, isError: boolean = false): P
382
383
  randomToken = constants.randomToken;
383
384
  }
384
385
 
385
- if (constants.userDataDirectory) try {
386
- fs.rmSync(constants.userDataDirectory, { recursive: true, force: true });
387
- } catch (error) {
388
- consoleLogger.warn(`Unable to force remove userDataDirectory: ${error.message}`);
386
+ if (constants.userDataDirectory) {
387
+ try {
388
+ fs.rmSync(constants.userDataDirectory, { recursive: true, force: true });
389
+ } catch (error) {
390
+ consoleLogger.warn(`Unable to force remove userDataDirectory: ${error.message}`);
391
+ }
392
+
393
+ // Also remove _pool* sibling directories created by browser pool re-launches
394
+ try {
395
+ const poolDirs = globSync(`${constants.userDataDirectory}_pool*`);
396
+ for (const dir of poolDirs) {
397
+ fs.rmSync(dir, { recursive: true, force: true });
398
+ }
399
+ } catch (error) {
400
+ consoleLogger.warn(`Unable to remove pool directories: ${error.message}`);
401
+ }
389
402
  }
390
403
 
391
404
  if (process.env.TMPDIR && fs.existsSync('/.dockerenv')) try {