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

droppedEntriesCount can be inconsistent with reported entries #214

Open
rubennorte opened this issue Sep 23, 2024 · 1 comment
Open

droppedEntriesCount can be inconsistent with reported entries #214

rubennorte opened this issue Sep 23, 2024 · 1 comment

Comments

@rubennorte
Copy link

I think the determination of the droppedEntriesCount for a given observer can be inconsistent with the data reported to the observer. This is because we flush the entries in the buffers when using the buffered option and start listening to entries when calling observe, but the determination of droppedEntriesCount happens when the callback is invoked.

Let's take the following example:

  • We create an observer and call observe for resource type, with the buffered option set to true.
    • At that moment, the observer buffer is filled with all the existing entries in the buffer.
  • Multiple entries of type resource are added to the buffer. The buffer becomes full and drops N entries, but the previous observer didn't miss any entries as they were added to its buffer.
  • The observer callback is invoked with the entries in its buffer. The observer didn't miss any entries and droppedEntriesCount is N (inconsistent with the data reported to the observer).

I think the determination of droppedEntriesCount should be made in observe, not in the execution of its callback.

@clelland
Copy link
Contributor

clelland commented Oct 8, 2024

Hi @rubennorte! Thanks for the report - do you think you'd be able to write a WPT to demonstrate this?

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

No branches or pull requests

2 participants