Repository navigation
fix(sdk): return the result from pollUntilHasData and pollUntilOk retries - #1150
Open
pucedoteth wants to merge 1 commit into
Open
pucedoteth wants to merge 1 commit into
pucedoteth wants to merge 1 commit into
Conversation
…ries Both helpers awaited their recursive call without returning it, so a result that arrived after the first attempt resolved to undefined. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
@pucedoteth is attempting to deploy a commit to the Uneven Labs Team on Vercel. A member of the Team first needs to authorize it. |
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
pollUntilHasDataandpollUntilOkare exported from@relayprotocol/relay-sdk, but they only return their result when it arrives on the first attempt. When a later attempt succeeds, the caller getsundefined:Each function awaits its recursive call but never returns it, so the value from the attempt that succeeded is dropped.
Modifications
packages/sdk/src/utils/pollApi.ts:returnthe recursive call in both functions, so the data (ortrue) from the successful attempt reaches the caller.packages/sdk/src/utils/pollApi.test.ts: new tests where the first response fails the check and the second passes. Onmainthey getundefined, and with this change they get the data andtrue.@relayprotocol/relay-sdkpatch.Checklist
Validation: in
packages/sdk,vitest runpasses 99 tests in 12 files, andtsc --noEmitand Prettier are clean.🤖 Generated with Claude Code