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 race condition in stream opening #6760

Merged
merged 2 commits into from
Dec 12, 2023
Merged

Conversation

kschiffer
Copy link
Contributor

Summary

This PR will address a possible race condition in the event stream logic when opening multiple subscriptions in quick succession. It also addresses an unnecessary stream closure event when switching between verbose and normal filtering.

Changes

  • Make sure to send the subscription message only when the stream has been opened
  • Fix wrong scoping of state variable in the stream library

Testing

  • The underlying issue is somewhat hard to reproduce
  • It can happen sometimes when opening a device data page and refreshing the page
  • Based on how fast the connections (app events and dev events) are opened there can be a race condition where the device stream tries to send the subscripiton message before the stream was opened

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • The steps/process to test this feature are clearly explained including testing for regressions.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@kschiffer kschiffer added bug Something isn't working c/console This is related to the Console c/sdk/js This is related to the JavaScript SDK labels Dec 12, 2023
@kschiffer kschiffer added this to the v3.28.2 milestone Dec 12, 2023
@kschiffer kschiffer self-assigned this Dec 12, 2023
@kschiffer kschiffer requested a review from a team as a code owner December 12, 2023 09:17
@github-actions github-actions bot added ui/web This is related to a web interface and removed c/console This is related to the Console labels Dec 12, 2023
@PavelJankoski PavelJankoski merged commit 291ac27 into v3.28 Dec 12, 2023
13 checks passed
@PavelJankoski PavelJankoski deleted the fix/event-stream-reconnect-3 branch December 12, 2023 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c/sdk/js This is related to the JavaScript SDK ui/web This is related to a web interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants