Using AnswerAsync() with Task.Run() causes the mediasession to be
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- csharp
調査の方向性
まず CallsOnIncoming、AnswerAsync()、Task.Run()、CallsOnUpdated の間の相互作用を再現し、MediaSession が null になるタイミングを記録します。これらのエントリポイントにまたがる通話とメディアセッションのライフサイクルを追跡し、Task.Run() の有無で実行を比較します。完了とは、応答された通話が一貫して MediaSession を公開し、拒否された通話が引き続き安全にフィルタリングされる状態を指します。
索引モデルが issue の本文から書いたものです。
説明
Describe the issue
We tried to wrap call.AnswerAsync() inside of Task.Run() and it resulted in an issue where the MediaSession on a ICall was often null instead of the expected value.
Code Snippet
This code works as expected
ICommunicationsClient client;
client.Calls().OnIncoming += CallsOnIncoming;
client.Calls().OnUpdated += CallsOnUpdated;
private void CallsOnIncoming(ICallCollection sender, CollectionEventArgs<ICall> args)
{
foreach (var call in args.AddedResources)
{
if (callShouldBeAccepted()) // business logic to decide if we answer or reject
{
// Here we answer the call:
ILocalMediaSession session = CreateMediaSession(/*...*/);
call.AnswerAsync(session, /*...*/);
} else {
// Here we reject it
call.RejectAsync(RejectReason.Forbidden);
}
}
}
private void CallsOnUpdated(ICallCollection sender, CollectionEventArgs<ICall> args)
{
foreach (var call in args.AddedResources)
{
// rejected calls also show up here for some reason, so we filter those:
if (call.MediaSession is null)
{
// rejected calls don't have a MediaSession
_logger.LogInformation("Skipping call init (no MediaSession)");
continue;
}
// otherwise, handle the call as usual...
// <call handling logic here>
}
}
Adding Task.Run() breaks things
Task.Run(async () => await call.AnswerAsync(session, /*...*/));
Now the MediaSession is often null for calls that we answered. And we see this in the logs:
Skipping call init (no MediaSession)
Skipping call init (no MediaSession)
Skipping call init (no MediaSession)
In our testing, it happens approximately 15-30% of calls, but this varies. My guess is an issue due to the task being scheduled on a different thread.
Expected behavior
It should behave the same way it did before using Task.Run()
Graph SDK (please complete the following information):
- Version 1.31.0.225 (but the issue is the same with older versions)
Call ID
Provide the list call ids that encountered this issue. Include the time in UTC/GMT when these call have occurred.
Logs
If required, please add logs from the SDK. (Please remove any PII from the logs before uploading)
Additional context
Add any other context about the problem here.
- 主要言語
- 言語のデータがありません
- スター
- 252
- フォーク
- 276
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoftgraph/microsoft-graph-comms-samples のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
microsoftgraph/microsoft-graph-comms-samples#871 · コメント 5 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
microsoftgraph/microsoft-graph-comms-samples#870 · コメント 11 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
microsoftgraph/microsoft-graph-comms-samples#869 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoftgraph/microsoft-graph-comms-samples#868 · コメント 1 件 ·
microsoftgraph/microsoft-graph-comms-samples の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
issue: Kokoro.js (Browser) never finishes loading when the browser offers WebGPU but has no GPU adapter対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-webui/open-webui#33232 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
WebRTC audio: stop_recording() doesn't flush queued samples対応中かも @bniladridas が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pollen-robotics/reachy_mini#1508 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
libsndfile/libsndfile#1188 ·
メンテナーはふだん 7 日以内に返信