Skip to content

Commit 8fc6578

Browse files
committed
fix(account-switcher): remove obsolete native probe
1 parent cba3cfc commit 8fc6578

3 files changed

Lines changed: 0 additions & 139 deletions

File tree

‎linux-features/account-switcher/README.md‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@ mkdir -p "$test_tmp"
8989
TMPDIR="$test_tmp" node --test linux-features/account-switcher/test.js
9090
```
9191

92-
Set `CODEX_ACCOUNT_SWITCHER_NATIVE_APP` to an extracted official application
93-
root and `CODEX_ACCOUNT_SWITCHER_ASAR_CLI` to `@electron/asar/bin/asar.mjs` to also
94-
run the native Owl regression test. This requires a graphical session and an
95-
unlocked Secret Service provider. It generates a disposable probe, uses synthetic
96-
credentials, verifies key persistence and vault decryption in fresh switcher
97-
instances, and exercises **Add account** with the official connection class's
98-
request/subscription methods. An initially disconnected hosted connection must
99-
remain untouched, and the probe rejects any attempts to query global cloud work.
100-
The probe uses a synthetic transport and intercepts the browser launch, then
101-
cancels OAuth; it does not log in to real accounts. It exits only its own process
102-
and clears only its own test key.
103-
Do not set a long build `TMPDIR` when launching a desktop app: Chromium's socket
104-
path must fit the Unix-domain socket limit. Use `TMPDIR="$XDG_RUNTIME_DIR"` for
105-
interactive launches instead.
106-
10792
Set `CODEX_ACCOUNT_SWITCHER_CLI` to the extracted official `resources/codex` to
10893
also check credential-file decoding and the idle-check protocol in a disposable,
10994
unauthenticated app server. This does not test OAuth with real accounts.

‎linux-features/account-switcher/native-probe.js‎

Lines changed: 0 additions & 87 deletions
This file was deleted.

‎linux-features/account-switcher/test.js‎

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -667,40 +667,3 @@ test("official main and profile dropdown chunks patch uniquely and remain valid
667667
}
668668
}
669669
});
670-
671-
test("official Owl reaches OAuth and reopens an encrypted vault without querying independent cloud work", {
672-
skip: !process.env.CODEX_ACCOUNT_SWITCHER_NATIVE_APP || !process.env.CODEX_ACCOUNT_SWITCHER_ASAR_CLI,
673-
timeout: 30_000,
674-
}, t => {
675-
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "account-native-"));
676-
const app = process.env.CODEX_ACCOUNT_SWITCHER_NATIVE_APP;
677-
const home = path.join(dir, "home"), profile = path.join(dir, "profile");
678-
const probe = path.join(dir, "app"), source = path.join(dir, "source");
679-
fs.mkdirSync(path.join(probe, "resources"), { recursive: true });
680-
fs.mkdirSync(source);
681-
t.after(() => {
682-
if (fs.existsSync(home)) {
683-
const id = crypto.createHash("sha256").update(fs.realpathSync(home)).digest("hex");
684-
try { execFileSync("secret-tool", ["clear", "application", "codex-desktop", "feature", "account-switcher", "profile", id], { stdio: "ignore", timeout: 5_000 }); } catch {}
685-
}
686-
fs.rmSync(dir, { recursive: true, force: true });
687-
});
688-
fs.copyFileSync(path.join(app, "ChatGPT"), path.join(probe, "ChatGPT"));
689-
fs.chmodSync(path.join(probe, "ChatGPT"), 0o755);
690-
for (const name of fs.readdirSync(app)) {
691-
if (["ChatGPT", "resources", "start.sh", ".codex-linux"].includes(name)) continue;
692-
fs.symlinkSync(path.join(app, name), path.join(probe, name));
693-
}
694-
for (const name of ["owl-app.ini", "owl-electron-app.json"]) fs.copyFileSync(path.join(app, "resources", name), path.join(probe, "resources", name));
695-
fs.copyFileSync(path.join(__dirname, "native-probe.js"), path.join(source, "probe.js"));
696-
fs.writeFileSync(path.join(source, "package.json"), JSON.stringify({ name: "account-native-probe", version: "1.0.0", main: "probe.js" }));
697-
execFileSync(process.execPath, [process.env.CODEX_ACCOUNT_SWITCHER_ASAR_CLI, "pack", source, path.join(probe, "resources/app.asar")], { stdio: "pipe", timeout: 5_000 });
698-
const result = path.join(dir, "result.json");
699-
execFileSync(path.join(probe, "ChatGPT"), [`--user-data-dir=${profile}`], {
700-
env: { ...process.env, TMPDIR: process.env.XDG_RUNTIME_DIR || "/tmp", CODEX_HOME: home, CODEX_ELECTRON_USER_DATA_PATH: profile,
701-
ACCOUNT_SWITCHER_PROBE_RUNTIME: process.env.CODEX_ACCOUNT_SWITCHER_PROBE_RUNTIME || path.join(__dirname, "runtime.js"), ACCOUNT_SWITCHER_PROBE_RESULT: result,
702-
ACCOUNT_SWITCHER_PROBE_NATIVE_APP: app },
703-
stdio: "pipe", timeout: 20_000,
704-
});
705-
assert.deepEqual(JSON.parse(fs.readFileSync(result)), { menus: 3, encryptedVault: true, errors: [], openedLogin: 1, readyChecks: 4, cloudUntouched: true });
706-
});

0 commit comments

Comments
 (0)