-
Notifications
You must be signed in to change notification settings - Fork 71
Fix switch to polling #766
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
Conversation
| } | ||
|
|
||
| async start(): Promise<void> { | ||
| this.stopped = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was a bug preventing updates after switching from streaming to polling multiple times
| export class StreamingFetcher extends EventEmitter implements FetcherInterface { | ||
| private eventSource: EventSource | undefined; | ||
|
|
||
| private stopped = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this variable in streaming since we have event listener that we register and unregister
| t.is(repo.getMode(), 'polling'); | ||
| t.true(eventSource.closed); | ||
|
|
||
| await repo.fetch(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the test will now work without manual fetch trigger and based on the mode change alone
Pull Request Test Coverage Report for Build 17553138244Details
💛 - Coveralls |
About the changes
When switching from streaming to polling and polling was previously stopped we need to start it again.
Also changed mode change event after switchover is successful.
Important files
Discussion points