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

Unhandled rejection in Firefox 69 #51

Closed
chasenlehara opened this issue Sep 4, 2019 · 0 comments · Fixed by #52
Closed

Unhandled rejection in Firefox 69 #51

chasenlehara opened this issue Sep 4, 2019 · 0 comments · Fixed by #52
Assignees
Labels

Comments

@chasenlehara
Copy link
Member

Firefox 69 now emits the unhandledrejection event by default. Unfortunately, there’s a bug where the unhandled rejection event is emitted when source.start() rejects from new ReadableStream(source). This bug affects this test:

conditionalAsyncTest('malformed json', function(assert) {
var malformed_string = "{\"1\":2}\n{sss: 2}";
var readObjects = [];
var todoStream = ndjsonStream( readableStreamFromString(malformed_string) );
var reader = todoStream.getReader();
var errorCaught = false;
function errCheck() {
errorCaught = true;
}
var done = assert.async();
var allDone = reader.read().then(function read(result) {
if (result.start) {
return;
}
readObjects.push(result.value);
return reader.read().then(read, errCheck);
}, errCheck);
allDone.then(function(){
assert.strictEqual(errorCaught, true, "malformed json string should cause an error");
done();
}, function(){
assert.strictEqual(errorCaught, true, "rejected: malformed json string should cause an error");
done();
});
});

I don’t think we can do anything about this, so for the purposes of testing, I think we should work around it by adding QUnit.onUnhandledRejection = function() {} to our test so the unhandled rejection is “handled” and the tests don’t fail in Firefox 69.

The alternative is to change the main CanJS test suite to run Firefox 68 until this bug gets fixed, but I think that’s a worse alternative because I don’t think we should test against an older version of Firefox just because of this issue.

@chasenlehara chasenlehara added the p1 label Sep 4, 2019
@chasenlehara chasenlehara self-assigned this Sep 4, 2019
chasenlehara pushed a commit that referenced this issue Sep 4, 2019
This implements a workaround for this bug in Firefox 69: https://bugzilla.mozilla.org/show_bug.cgi?id=1561911

Closes #51
chasenlehara pushed a commit that referenced this issue Sep 4, 2019
This implements a workaround for this bug in Firefox 69: https://bugzilla.mozilla.org/show_bug.cgi?id=1561911

Closes #51
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 a pull request may close this issue.

1 participant