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

MBS-11114: Allow track times to be unset #1712

Merged
merged 1 commit into from Sep 30, 2020

Conversation

mwiencek
Copy link
Member

0d45452 broke this by incorrectly removing the "useless" isNaN check, which it turns out was not "useless." The result of unformatTrackLength is null when the length is empty, so the bug is that we'd bail out too early with the new check and fail to set this.length(newLength). The result is only NaN when the input can't be parsed. A test is now added.

@@ -159,7 +159,7 @@ class Track {

var newLength = utils.unformatTrackLength(length);

if (!newLength) {
if (Number.isNaN(newLength)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This previously used https://lodash.com/docs/4.17.15#isNaN which is based on Number.isNaN, not isNaN:

Note: This method is based on Number.isNaN and is not the same as global isNaN which returns true for undefined and other non-number values.

0d45452 broke this by incorrectly
removing the "useless" isNaN check, which it turns out was not
"useless." The result of `unformatTrackLength` is null when the length
is empty, so the bug is that we'd bail out too early with the new check
and fail to set `this.length(newLength)`. The result is only NaN when
the input can't be parsed. A test is now added.
Copy link
Member

@reosarevok reosarevok left a comment

Choose a reason for hiding this comment

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

Whoops.

@mwiencek mwiencek added Bug Bugs that should be checked/fixed soonish Regression/Beta Bugs that are either on beta or new regressions and should be checked ASAP labels Sep 24, 2020
Copy link
Contributor

@yvanzo yvanzo left a comment

Choose a reason for hiding this comment

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

:shipit:

@mwiencek mwiencek merged commit 61d0e22 into metabrainz:master Sep 30, 2020
@mwiencek mwiencek deleted the mbs-11114 branch September 30, 2020 17:50
reosarevok pushed a commit to reosarevok/musicbrainz-server that referenced this pull request Oct 7, 2020
0d45452 broke this by incorrectly
removing the "useless" isNaN check, which it turns out was not
"useless." The result of `unformatTrackLength` is null when the length
is empty, so the bug is that we'd bail out too early with the new check
and fail to set `this.length(newLength)`. The result is only NaN when
the input can't be parsed. A test is now added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bugs that should be checked/fixed soonish Regression/Beta Bugs that are either on beta or new regressions and should be checked ASAP
Projects
None yet
3 participants