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 multiple races in logbook subscriptions #12878

Merged
merged 9 commits into from
Jun 7, 2022

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jun 4, 2022

Proposed change

  • If the user switched between tabs quickly there could be
    logbook messages delivered after we switch tabs but before
    we complete the unsubscribe

  • If they return to the tab to quickly the logbook data would
    not have been removed and the new subscription could get
    appended to it causing duplicate events to appear

  • Catch the backend unsubscribing the stream when everything requested
    is filtered (like the error seen here Live Logbook stopped being live (using Cloud/Google assistant?) core#72963 (comment))

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

- If the user switched between tabs quickly there could be
  logbook messages delivered after we switch tabs but before
  we complete the unsubscribe

- If they return to the tab to quickly the logbook data would
  not have been removed and the new subscription could get
  appended to it causing duplicate events to appear
@bdraco

This comment was marked as outdated.

@bdraco bdraco marked this pull request as ready for review June 5, 2022 00:54
@bdraco bdraco marked this pull request as draft June 5, 2022 01:09
@bdraco
Copy link
Member Author

bdraco commented Jun 5, 2022

One more issue is when you switch tabs and come back to the tab it show no rows for a second instead of loading

balloob
balloob previously approved these changes Jun 6, 2022
balloob
balloob previously approved these changes Jun 6, 2022
@balloob balloob merged commit b1a3996 into home-assistant:dev Jun 7, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants