Skip to content

Conversation

@kwasniew
Copy link
Contributor

@kwasniew kwasniew commented Sep 8, 2025

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

}

async start(): Promise<void> {
this.stopped = false;
Copy link
Contributor Author

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;
Copy link
Contributor Author

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();
Copy link
Contributor Author

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

@kwasniew kwasniew requested a review from Tymek September 8, 2025 13:53
@coveralls
Copy link

Pull Request Test Coverage Report for Build 17553138244

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.005%) to 89.981%

Totals Coverage Status
Change from base Build 17550223902: -0.005%
Covered Lines: 1211
Relevant Lines: 1288

💛 - Coveralls

@kwasniew kwasniew merged commit 860f681 into main Sep 8, 2025
6 checks passed
@kwasniew kwasniew deleted the fix-switch-to-polling branch September 8, 2025 13:57
@github-project-automation github-project-automation bot moved this from New to Done in Issues and PRs Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants