Repository navigation
fix(sdk): preserve device and session ids after failed requests - #670
pcbeingused333 wants to merge 1 commit into
Conversation
Keep resolved identifiers when tracking returns no result so subsequent replay chunks can still be sent.
|
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
A failed tracking request currently clears previously resolved device and session IDs because
send()assigns IDs even whenApi.fetch()returnsnull. Subsequent replay chunks are then queued because the SDK no longer has a session.Return without updating identifiers when the request has no result. Successful responses still update the IDs and retain the existing first-session queue flush behavior.
Testing
The SDK regression test first resolves IDs, simulates a failed request returning
null, checks that both IDs survive, and verifies a subsequent replay reaches the API. Before the fix: 3 passed, 1 failed. After the fix: 4 passed, 0 failed (bun test ./packages/sdks/sdk/src/index.test.ts).AI assistance: this change and regression test were generated with Codex.
Summary by CodeRabbit