Skip to content

add an optional timeout parameter to setImage#72

Merged
dansheme merged 2 commits intomainfrom
timeout
Jan 26, 2026
Merged

add an optional timeout parameter to setImage#72
dansheme merged 2 commits intomainfrom
timeout

Conversation

@dansheme
Copy link
Contributor

@dansheme dansheme commented Jan 26, 2026

Note

Adds configurable timeout support for sending reference images in realtime flows.

  • Extends setImage (client and manager) and setImageBase64 (connection) to accept options.timeout with default 15000ms
  • Uses options.timeout ?? AVATAR_SETUP_TIMEOUT_MS for set_image ack waiting; preserves existing behavior when not provided
  • Adds unit tests verifying custom and default timeout behavior; updates test imports to use vi timers

Written by Cursor Bugbot for commit 014310a. This will update automatically on new commits. Configure here.

@dansheme dansheme requested a review from Copilot January 26, 2026 22:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds an optional timeout parameter to the setImage method across the realtime SDK, allowing callers to customize the timeout duration for image send operations instead of always using the default 15-second timeout.

Changes:

  • Added timeout parameter to the setImage method signature in the client, manager, and connection layers
  • Implemented timeout logic using the custom value when provided, falling back to the default AVATAR_SETUP_TIMEOUT_MS
  • Added comprehensive unit tests to verify both custom and default timeout behavior

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
packages/sdk/src/realtime/client.ts Updated setImage method signature in RealTimeClient type and implementation to include optional timeout parameter
packages/sdk/src/realtime/webrtc-manager.ts Updated setImage method signature to accept timeout parameter and pass it through to the connection layer
packages/sdk/src/realtime/webrtc-connection.ts Implemented timeout logic using options?.timeout ?? AVATAR_SETUP_TIMEOUT_MS in setImageBase64 method
packages/sdk/tests/unit.test.ts Added test suite for timeout behavior covering both custom and default timeout scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/DecartAI/sdk/@decartai/sdk@72

commit: 014310a

@dansheme dansheme merged commit 98017ca into main Jan 26, 2026
5 checks passed
@dansheme dansheme deleted the timeout branch January 26, 2026 22:30
dansheme added a commit that referenced this pull request Jan 26, 2026
<!-- CURSOR_SUMMARY -->
> [!NOTE]
> Adds configurable timeout support for sending reference images in
realtime flows.
> 
> - Extends `setImage` (client and manager) and `setImageBase64`
(connection) to accept `options.timeout` with default `15000ms`
> - Uses `options.timeout ?? AVATAR_SETUP_TIMEOUT_MS` for `set_image`
ack waiting; preserves existing behavior when not provided
> - Adds unit tests verifying custom and default timeout behavior;
updates test imports to use `vi` timers
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
014310a. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants