Skip to content

fix(ice): filter out discarded candidates#865

Merged
thomaseizinger merged 1 commit intomainfrom
fix/filter-discarded-candidates
Feb 13, 2026
Merged

fix(ice): filter out discarded candidates#865
thomaseizinger merged 1 commit intomainfrom
fix/filter-discarded-candidates

Conversation

@thomaseizinger
Copy link
Collaborator

@thomaseizinger thomaseizinger commented Feb 13, 2026

When a local or remote candidate gets invalidated, str0m internally sets a discarded flag instead of removing the Candidate. This allows us to retain the indices into the local_candidates and remote_candidates lists.

Unfortunately, with the current getters of local_candidates and remote_candidates, this implementation detail leaks through because those discarded candidates still get returned there.

In order to provide a consistent view of the world to the user, we change the API to return an Iterator instead and filter the candidates by the discarded flag.

When a local or remote candidate gets invalidated, str0m internally sets
a `discarded` flag instead of removing the `Candidate`. This allows us
to retain the indices into the `local_candidates` and
`remote_candidates` lists.

Unfortunately, with the current getters of `local_candidates` and
`remote_candidates`, this implementation detail leaks through because
those discarded candidates still get returned there.

In order to provide a consistent view of the world to the user, we
change the API to return an Iterator instead and filter the candidates
by the `discarded` flag.
Copy link
Owner

@algesten algesten left a comment

Choose a reason for hiding this comment

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

LGTM!

@thomaseizinger thomaseizinger merged commit 0f06919 into main Feb 13, 2026
55 checks passed
@thomaseizinger thomaseizinger deleted the fix/filter-discarded-candidates branch February 13, 2026 20:04
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