Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ describe('runRewindSubmit durable-address discipline (#87059)', () => {
expect(submit?.params?.confirm_truncate).toBeUndefined()
})

it('leaves a bound durable rowId untouched (no extra history call)', async () => {
it('leaves a bound durable rowId untouched (no extra history call) but drops the client ordinal', async () => {
const calls: Call[] = []

await runRewindSubmit(makeGateway(calls), 'sid', 'fixed prompt', 1, undefined, false, undefined, 13, 'typo prompt')
Expand All @@ -485,7 +485,7 @@ describe('runRewindSubmit durable-address discipline (#87059)', () => {
const submit = calls.find(call => call.method === 'prompt.submit')

expect(submit?.params?.truncate_before_row_id).toBe(13)
expect(submit?.params?.truncate_before_user_ordinal).toBe(1)
expect(submit?.params?.truncate_before_user_ordinal).toBeUndefined()
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,15 @@ export async function runRewindSubmit(
// gateway's 4030 cross-check. Unresolved: plain resubmit, no truncation.
resolvedOrdinal = undefined
resolvedMessageId = undefined
} else if (wantsTruncation && typeof truncateRowId === 'number') {
// The caller already bound a durable ROW id. Keep it as the SOLE address
// and drop the ordinal the same way: the two ordinal spaces can diverge
// (failed turns are skipped client-side while durable repair merges
// adjacent user rows), and the gateway refuses the ordinal+row_id
// combination with 4030 whenever they disagree (#82756). messageId-only
// restores keep their ordinal — there the ordinal is still part of the
// address (stale rendered ids fall back to it, #82462).
resolvedOrdinal = undefined
}

const interrupt = async () => {
Expand Down
Loading