Skip to content

Remove redundant AsyncId checks from instruction callbacks#232

Open
MaxHeimbrock wants to merge 1 commit intomainfrom
max/remove-redundant-asyncid
Open

Remove redundant AsyncId checks from instruction callbacks#232
MaxHeimbrock wants to merge 1 commit intomainfrom
max/remove-redundant-asyncid

Conversation

@MaxHeimbrock
Copy link
Copy Markdown
Contributor

Summary

  • FfiClient.TryDispatchPendingCallback() already matches callbacks by requestAsyncId via ConcurrentDictionary.TryRemove before invoking the callback, so the per-instruction if (e.AsyncId != _asyncId) return; guard was dead code.
  • Removed the stored _asyncId field, assignment, and guard from all 12 custom instruction classes across Participant.cs, Room.cs, Track.cs, and DataStream.cs.
  • The asyncId constructor parameter is kept since it is still passed to RegisterPendingCallback.

Test plan

  • Verify CI passes (existing unit/integration tests cover the affected instruction classes)
  • Manual smoke test: connect to a room, publish a track, perform RPC, send text/file streams, and confirm all callbacks still fire correctly

🤖 Generated with Claude Code

FfiClient.TryDispatchPendingCallback already matches callbacks by
requestAsyncId via ConcurrentDictionary.TryRemove before invoking the
callback. The per-instruction AsyncId guard was therefore dead code.
Remove the stored _asyncId field and guard from all 12 custom
instruction classes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant