Skip to content

Commit c62af5d

Browse files
committed
test(metadata-protocol): the added-member move reads back before it deletes the unbound row
Claude-Session: https://claude.ai/code/session_01ADHkmS3jJf5LgjHTU7Cs6W Co-authored-by: Claude <noreply@anthropic.com>
1 parent 505a5ab commit c62af5d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎packages/objectql/src/environment-overlay-email-locale-restart.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,17 @@ describe('[#28904] the ceremony moves a row of a member the package does not shi
10281028
expect((await sentMember(raw, DIGEST, 'zh-CN'))?.subject).toBe(`ADMIN ${DIGEST} zh-CN`);
10291029
});
10301030

1031+
it('READ BACK FIRST: a save that leaves no row of that member in the pair keeps the unbound row, and the row is reported failed', async () => {
1032+
const { stores, raw } = await withUnboundZh(DIGEST);
1033+
// A save door that answers and writes nothing.
1034+
(raw as any).saveMetaItem = async () => ({ success: true });
1035+
const result = await migrate(raw);
1036+
expect(result.outcomes.map((o: any) => o.outcome)).toEqual(['failed']);
1037+
expect(result.outcomes[0].error).toContain("does not read back as its own member 'zh-CN'");
1038+
expect(rowsOf(stores, DIGEST).map((r) => [r.packageId, r.member])).toEqual([[null, 'zh-CN']]);
1039+
expect(result.bases[0]).toMatchObject({ moved: 0, failed: 1 });
1040+
});
1041+
10311042
it('CONTROL a shipped locale: moved as the declared override of the package, as before', async () => {
10321043
const { stores, raw } = await withUnboundZh(NAME);
10331044
const listed = await census(raw);

0 commit comments

Comments
 (0)