-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,6 @@ import { FetcherInterface, StreamingFetchingOptions } from './fetcher'; | |
| export class StreamingFetcher extends EventEmitter implements FetcherInterface { | ||
| private eventSource: EventSource | undefined; | ||
|
|
||
| private stopped = false; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| private options: StreamingFetchingOptions; | ||
|
|
||
| constructor(options: StreamingFetchingOptions) { | ||
|
|
@@ -85,7 +83,6 @@ export class StreamingFetcher extends EventEmitter implements FetcherInterface { | |
| } | ||
|
|
||
| stop() { | ||
| this.stopped = true; | ||
| if (this.eventSource) { | ||
| this.eventSource.close(); | ||
| this.eventSource = undefined; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1938,8 +1938,6 @@ test('setMode can switch from streaming to polling mode', async (t) => { | |
| t.is(repo.getMode(), 'polling'); | ||
| t.true(eventSource.closed); | ||
|
|
||
| await repo.fetch(); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| toggles = repo.getToggles(); | ||
| t.is(toggles[0].enabled, true); | ||
|
|
||
|
|
||
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