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

Fixed issue where pause throws an error #6938

Merged
merged 16 commits into from
Jan 13, 2023
Prev Previous commit
Next Next commit
More cleanpu
  • Loading branch information
maneesht committed Jan 11, 2023
commit 8ce7a460ef00ea3383d6e332762a766d9d34816d
2 changes: 1 addition & 1 deletion .changeset/eleven-cycles-hang.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@firebase/storage": patch
---

Fixed issue where pause throws an error
Fixed issue where pause throws an error when a request is in flight.
8 changes: 4 additions & 4 deletions config/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ module.exports = {
'object': 'it',
'property': 'skip'
},
// {
// 'object': 'it',
// 'property': 'only'
// },
{
'object': 'it',
'property': 'only'
},
{
'object': 'describe',
'property': 'skip'
Expand Down
1 change: 0 additions & 1 deletion packages/storage/src/task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ export class UploadTask {
}

private _transition(state: InternalTaskState): void {
console.log(`transitioning from ${this._state} to ${state}`);
if (this._state === state) {
return;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/storage/test/unit/task.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ describe('Firebase Storage > Upload Task', () => {
resolve(null);
});
await pausedDeferred.promise;
// Need to wait until the state has settled [i.e. from pausing to pause] and allow for any potential errors to propagate.
await new Promise(resolve => setTimeout(resolve, 1000));
maneesht marked this conversation as resolved.
Show resolved Hide resolved
task.resume();
return promise;
Expand Down Expand Up @@ -723,7 +724,7 @@ describe('Firebase Storage > Upload Task', () => {
expect(clock.countTimers()).to.eq(0);
clock.restore();
});
it.only('does not error after the first progress is uploaded', async () => {
it('does not error after the first progress is uploaded', async () => {
// Kick off upload
await runProgressPauseTest(bigBlob);
});
Expand Down