Skip to content

Commit 54d6b48

Browse files
committed
fix(doctor): satisfy shared auth relocation validation
1 parent 824aaf5 commit 54d6b48

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

‎src/infra/state-migrations.shared-auth-store.test.ts‎

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,19 +276,15 @@ describe("shared auth store relocation", () => {
276276
const stateRow = source
277277
.prepare("SELECT state_json, updated_at FROM auth_profile_state WHERE state_key = 'primary'")
278278
.get() as { state_json: string; updated_at: number };
279-
const credential = fixture.sharedStore.profiles["openai:shared"];
280279
const targetStore = {
281280
profiles: {
282281
...makeStore("openai:extra", "extra-key").profiles,
283282
...(scenario === "source-only profile"
284283
? {}
285-
: {
286-
"openai:shared": {
287-
key: scenario === "changed credential" ? "different-key" : credential.key,
288-
provider: credential.provider,
289-
type: credential.type,
290-
},
291-
}),
284+
: makeStore(
285+
"openai:shared",
286+
scenario === "changed credential" ? "different-key" : "shared-key",
287+
).profiles),
292288
},
293289
version: 1,
294290
...(scenario === "changed metadata" ? { legacyMetadata: "keep" } : {}),

‎src/infra/state-migrations.shared-auth-store.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,12 @@ function recordMigrationLedger(
204204
.where("source_key", "=", sourceKey)
205205
.where("removed_source", "=", 0),
206206
);
207-
return {
208-
...entry,
207+
return Object.assign(entry, {
209208
sourceKey,
210209
sourceSha256: pending?.source_sha256 ?? rowDigest(entry.row),
211210
sourceRecordCount: pending?.source_record_count ?? Number(entry.row !== null),
212211
sourceSizeBytes: pending?.source_size_bytes ?? params.sourceSize,
213-
};
212+
});
214213
});
215214
const runHash = createHash("sha256");
216215
for (const entry of entries) {

0 commit comments

Comments
 (0)