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

Add ugly skipLog parameter to the synchronizeInventory method #1341

Merged
merged 1 commit into from
Dec 27, 2023

Conversation

peaBerberian
Copy link
Collaborator

@peaBerberian peaBerberian commented Dec 22, 2023

The synchronizeInventory method is an internal method of the RxPlayer allowing to synchronize our internal representation of media buffers (representing which segments are buffered where) with the anounced buffered TimeRanges of the media buffer as indicated by the web browser, which should be more up-to-date (e.g. take into consideration garbage collection).

As this internal representation of the buffer is very valuable when debugging, the synchronizeInventory produce logs each time it is called.

Yet that method is very often called when the debug element (under the DEBUG_ELEMENT feature) to be sure it is mostly up-to-date with the browser's buffer as the debug element is only shown in debugging contexts.

Calling that method in this context of visual debugging here has consequently the side-effect of producing a large ammount of debug logs, which isn't necessary.

Due to this, I decided to add an optional skipLog boolean parameter to the synchronizeInventory method. It is ugly, as it leaks debugging-related implementation details into the method signature, but it appears to me to be useful in that specific situation.

@peaBerberian peaBerberian added this to the 3.33.0 milestone Dec 22, 2023
The `synchronizeInventory` method is an internal method of the RxPlayer
allowing to synchronize our internal representation of media buffers
(representing which segments are buffered where) with the anounced
buffered TimeRanges of the media buffer as indicated by the web browser,
which should be more up-to-date (e.g. take into consideration garbage
collection).

As this internal representation of the buffer is very valuable when
debugging, the `synchronizeInventory` produce logs each time it is
called.

Yet that method is very often called when the debug element (under the
`DEBUG_ELEMENT` feature) to be sure it is mostly up-to-date with the
browser's buffer as it is an element only shown in debugging contexts.

Calling that method in this context of visual debugging here has
consequently the side-effect of producing a large ammount of debug logs,
which isn't necessary.

Due to this, I decided to add an optional `skipLog` boolean parameter to
the `synchronizeInventory` method. It is ugly, as it leaks
debugging-related implementation details into the method signature, but
it appears to me to be useful in that specific situation.
@peaBerberian peaBerberian merged commit 7540b8c into master Dec 27, 2023
3 checks passed
@peaBerberian peaBerberian mentioned this pull request Jan 24, 2024
@peaBerberian peaBerberian deleted the misc/segment-inventory-skipLog branch February 7, 2024 17:50
This pull request was closed.
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