Skip to content

Commit a169ffc

Browse files
test: telemetry no longer calls Account.active()
The two source guards expected the awaited call that the identity change removed; they now assert the call is gone and identity comes from the stored credential. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_011AhtJPr3nmT1Po92ZQk4VE
1 parent db50e50 commit a169ffc

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎packages/opencode/test/upstream/altimate-features.test.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,13 @@ describe("altimate features: telemetry fail-safe init", () => {
408408
expect(src).toContain("ALTIMATE_TELEMETRY_DISABLED")
409409
})
410410

411-
test("telemetry/index.ts awaits Account.active() (now async after bridge)", async () => {
411+
test("telemetry/index.ts no longer reads the account; identity comes from the stored credential", async () => {
412412
const src = await readSrc("altimate", "telemetry", "index.ts")
413-
// bridge merge note: Account.active() became async in v1.4.0
414-
expect(src).toMatch(/await Account\.active\(\)/)
413+
// The hashed account email left with the user-identity change: events carry the backend
414+
// user uuid and tenant resolved by TelemetryIdentity, so there is no Account.active() caller
415+
// here any more (it used to be awaited; Account.active() became async in v1.4.0).
416+
expect(src).not.toMatch(/Account\.active/)
417+
expect(src).toMatch(/TelemetryIdentity\.resolve\(/)
415418
})
416419
})
417420

‎packages/opencode/test/upstream/bridge-merge-v3.test.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ describe("bridge merge cycle 1: Account.active() is async — every caller await
8686
expect(content).toMatch(/accountSvc\.active\s*\(\s*\)/)
8787
})
8888

89-
test("altimate/telemetry/index.ts awaits Account.active()", async () => {
89+
test("altimate/telemetry/index.ts no longer calls Account.active()", async () => {
90+
// Telemetry stopped reading the account when events gained user_id and tenant from the
91+
// stored credential; the generic no-unawaited-call check below still covers any new caller.
9092
const content = await readText(path.join(srcDir, "altimate", "telemetry", "index.ts"))
91-
expect(content).toMatch(/await\s+Account\.active\s*\(\s*\)/)
93+
expect(content).not.toMatch(/Account\.active/)
9294
})
9395

9496
test("no source file calls Account.active() without await or assignment", async () => {

0 commit comments

Comments
 (0)