Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: suppress some ad events when outside of an ad break #102

Merged

Conversation

andrewjl-mux
Copy link
Contributor

@andrewjl-mux andrewjl-mux commented Nov 20, 2024

Filter out events we do not expect to receive outside of an ad break.

@andrewjl-mux andrewjl-mux changed the title fix: suppress adplaying when outside of an ad break fix: suppress some ad events when outside of an ad break Nov 20, 2024
@andrewjl-mux andrewjl-mux marked this pull request as ready for review November 20, 2024 23:35
@andrewjl-mux andrewjl-mux requested a review from a team as a code owner November 20, 2024 23:35
Copy link

@cjpillsbury cjpillsbury left a comment

Choose a reason for hiding this comment

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

On a quick glance only nits and minor suggestions. Otherwise, LGTM!

eventBus.dispatch(event)
if (muxPlayerState == MuxPlayerState.PLAYING_ADS) {
eventBus.dispatch(event)
} else {

Choose a reason for hiding this comment

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

nitpick: else if vs. else + (nested) if?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adCollector.dispatch(AdPlayEvent(null))
adCollector.dispatch(AdPlayingEvent(null))

Assert.assertTrue(

Choose a reason for hiding this comment

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

suggestion(non-blocking): use a loop + all expected filtered out ad events for your assertions. Alternatively, just write individual tests for every ad event like you did for the "allowed" ones, below (which allows test to better isolate an issue)

Copy link

@cjpillsbury cjpillsbury left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

@daytime-em daytime-em left a comment

Choose a reason for hiding this comment

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

me three

@andrewjl-mux andrewjl-mux merged commit e955ff8 into releases/v1.6.1 Nov 21, 2024
2 of 3 checks passed
@andrewjl-mux andrewjl-mux deleted the ajlb/fix/suppress-adplaying-outside-of-ad-breaks branch November 21, 2024 00:08
@github-actions github-actions bot mentioned this pull request Nov 22, 2024
daytime-em added a commit that referenced this pull request Nov 22, 2024
## Improvements

* fix: suppress some ad events when outside of an ad break (#102)
* fix: dropped frames not tracked (#103)

### Internal Library Updates
* Update `muxstats-android` to v1.4.4
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.

3 participants