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(browser): make sure that empty results array is still recognized #3486

Merged
merged 1 commit into from
Apr 30, 2020

Conversation

devoto13
Copy link
Collaborator

Otherwise empty array is treated as a single value, which causes issues down the road.

@karmarunnerbot
Copy link
Member

Build karma 222 completed (commit 352e1d19fd by @devoto13)

@karmarunnerbot
Copy link
Member

Build karma 223 completed (commit 352e1d19fd by @devoto13)

Copy link
Contributor

@johnjbarton johnjbarton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to understand the motivation better: this changes behavior in the case that result has zero length. We don't refresh the timer for example.

@devoto13
Copy link
Collaborator Author

You're right. I haven't really looked around the check. I'll investigate if it may cause unintended side effects.

@devoto13
Copy link
Collaborator Author

@johnjbarton I'm pretty sure this will not have unintended side effects. The only case which behaves differently is when result is [] (empty array). Before it would end up emitting spec_complete with [], but the handler expects a single result object and will crash as [].suite is undefined.

[] will not refresh a no activity timeout, but it should not really matter as client does not send [] at the moment and this change is just to add extra safety to avoid a potential crash.

Let me know if you still want me to remove the return, so no activity timeout is refreshed in this case?

@johnjbarton
Copy link
Contributor

yes let's call the refresh.

Otherwise empty array is treated as a single value, which causes issues down the road.
@karmarunnerbot
Copy link
Member

Build karma 229 completed (commit c9b7cf288a by @devoto13)

@karmarunnerbot
Copy link
Member

Build karma 228 completed (commit c9b7cf288a by @devoto13)

@devoto13
Copy link
Collaborator Author

@johnjbarton Done

@johnjbarton johnjbarton merged commit fa95fa3 into karma-runner:master Apr 30, 2020
@devoto13 devoto13 deleted the fix-array-check branch April 30, 2020 16:08
karmarunnerbot pushed a commit that referenced this pull request Apr 30, 2020
## [5.0.4](v5.0.3...v5.0.4) (2020-04-30)

### Bug Fixes

* **browser:** make sure that empty results array is still recognized ([#3486](#3486)) ([fa95fa3](fa95fa3))
@karmarunnerbot
Copy link
Member

🎉 This PR is included in version 5.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants