Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Calling Web SDK] AudioEffects disposes raw stream twice after acquisition failure (1.43.1)

未关闭
#603 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript, node.js

调研方向

The report isolates updateAudioEffectsStatusManager in the installed @azure/communication-calling 1.43.1 bundle at node_modules/@azure/communication-calling/dist-esm/sdk.bundle.js; it also mentions the parameterized method in 1.46.1. Read that method’s catch path and common cleanup, then run the supplied reproduce.mjs scenarios. Done means an acquired client is disposed once after acquisition failure and the original acquisition diagnostic is preserved.

由索引模型根据 Issue 内容生成。

描述

Summary

In @azure/communication-calling 1.43.1, the internal AudioEffects method
updateAudioEffectsStatusManager can dispose the same raw-stream client twice
when getMediaStream() rejects. The second disposal throws:

Error: Raw stream client is already disposed
    at ...checkDisposed
    at ...dispose
    at ...updateAudioEffectsStatusManager

This was observed during initialization in an embedded Windows Chromium test
browser when the UI reported unavailable camera/microphone access. Normal call
connection could still succeed after a browser permission response. This is not
a claim of a general call outage or a demonstrated cause of mid-call audio loss.
The original device-acquisition rejection reason/browser build was not captured.

Reproduction and scope

The following Node reproduction executes the unchanged method extracted from
the installed 1.43.1 SDK
, with synthetic stream/device collaborators. The raw
stream collaborator models the SDK's non-idempotent disposal guard. This isolates
the method's cleanup control flow; it is not an end-to-end browser/media test.

In an empty directory, install @azure/[email protected], save the
following as reproduce.mjs, then run node reproduce.mjs:

import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import vm from 'node:vm';

const source = await readFile(
  'node_modules/@azure/communication-calling/dist-esm/sdk.bundle.js', 'utf8');
const start = source.indexOf('async updateAudioEffectsStatusManager(){');
const end = source.indexOf('async initializeWasmVqeInStack(', start);
assert.ok(start > 0 && end > start);
const method = source.slice(start, end);
const initialize = vm.runInNewContext(
  `(${method.replace('async updateAudioEffectsStatusManager', 'async function')})`,
  {
    isVdi3Proxy: () => false,
    getBrowserInfo: () => ({ engine: 'Chrome' }),
    BrowserAudioEffectsHelper: class {},
  });

for (const scenario of ['valid-stream', 'acquisition-rejected', 'no-raw-stream']) {
  let disposed = false, disposeCalls = 0, settings;
  const stream = {
    getMediaStream: async () => {
      if (scenario === 'acquisition-rejected') {
        throw new Error('Synthetic device acquisition failure');
      }
      return { getAudioTracks: () => [{ getSettings: () => ({
        autoGainControl: false, noiseSuppression: false, echoCancellation: false,
      }) }] };
    },
    dispose: () => {
      disposeCalls++;
      if (disposed) throw new Error('Raw stream client is already disposed');
      disposed = true;
    },
  };
  const effects = {
    on: () => {}, setActiveEffects: value => { settings = value; },
    getActiveEffects: () => settings,
  };
  const device = {
    isWBMediaClient: false, getTsDeviceManager: () => ({}),
    getRawDeviceMediaStream: () => {
      if (scenario === 'no-raw-stream') throw new Error('Synthetic device absent');
      return stream;
    },
    callStackAudioEffectsStatusManager: effects,
  };
  let error = null;
  try {
    await initialize.call({
      streamInstance: { canStartEffects: true, source: { deviceManager: device } },
      _logger: { warn: () => {}, debug: () => {} },
    });
  } catch (caught) { error = caught.message; }
  console.log({ scenario, disposeCalls, error });
  assert.equal(disposeCalls, scenario === 'valid-stream' ? 1 :
    scenario === 'acquisition-rejected' ? 2 : 0);
  assert.equal(error, scenario === 'acquisition-rejected' ?
    'Raw stream client is already disposed' : null);
}
Actual
Input Dispose calls Error
Stream acquisition succeeds 1 None
Stream exists, acquisition rejects 2 Raw stream client is already disposed
Raw-stream creation throws before a stream exists 0 None

The catch path disposes the client; common code later disposes it again.

Expected

The SDK should clean up each acquired raw-stream client once, preserve the
device-acquisition diagnostic, and not introduce a second cleanup exception.

Version inspection

1.43.1 was exercised as above. Integrity-verified 1.46.1 package source was also
inspected and appears to retain the catch/common duplicate-disposal pattern in
the parameterized method. 1.46.1 was not executed in this reproduction. No
claim is made about 2.x behavior, and no SDK internals have been patched.

Could you confirm the supported fix/version or workaround that does not suppress
errors or bypass browser device permissions?

Reproduction signature: acs-web-audio-effects-double-dispose-1431.

主要语言
没有语言数据
星标
339
派生
114
平均合并
36 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/Communication 的其他 Issue

查看 Azure/Communication 的全部 Issue

相似的 Issue

更多 Audio/Video & RTC Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。