-
Notifications
You must be signed in to change notification settings - Fork 31
Description
setOutputDeviceAsync in vapi.ts doesn't return the promise from this.call?.setOutputDeviceAsync():
// vapi.ts:1020-1024
public setOutputDeviceAsync(
options: Parameters<DailyCall['setOutputDeviceAsync']>[0],
) {
this.call?.setOutputDeviceAsync(options); // missing return
}This means consumers can't catch errors from Daily.co's underlying setSinkId() call. await vapi.setOutputDeviceAsync(...) resolves immediately to undefined instead of waiting for the actual operation, so any rejection becomes an unhandled promise rejection.
We ran into this in production on Safari/WebKit browsers — Safari 18.4+ advertises setSinkId support but rejects with NotAllowedError outside a user gesture context, and there's no way to catch that through the Vapi wrapper right now. The only workaround is bypassing Vapi and calling getDailyCallObject()?.setOutputDeviceAsync() directly.
Fix is just adding return:
public setOutputDeviceAsync(
options: Parameters<DailyCall['setOutputDeviceAsync']>[0],
) {
return this.call?.setOutputDeviceAsync(options);
}(Checked the other delegation methods too — setInputDevicesAsync already returns correctly via safeSetInputDevicesAsync, and startScreenShare/stopScreenShare are fire-and-forget so those are fine.)
I've got a fix ready, will open a PR.