-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from FirebaseExtended/storage_fixes
* Don't cancel the upload if the task is unsubscribed from, this is unexpected behavior. `fromTask` is actually a hot-observable and the task controls it (having the cancel, pause, and resume functions) thus we should lean on the task to control itself to not surprise the developer * As such `fromTask` should be idempotent and immediately emit the latest snapshot, as the task is effective a Subject * Before completion `fromTask` was not emitting a `success` state, move to the promise form of the task to get that, as such `progress` was never reaching 100% * `fromTask` should emit an `error` or `canceled` snapshot, before the observable errors out; making for easier handling of errors. `takeWhile(snap => snap.state !== 'canceled')` for instance. * `put` and `putString` should be cold, replay, and cancel on unsubscribe however
- Loading branch information
Showing
22 changed files
with
6,022 additions
and
278 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"projects": { | ||
"default": "rxfire-test-c497c" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"database": { | ||
"rules": "test/database.rules.json" | ||
}, | ||
"firestore": { | ||
"rules": "test/firestore.rules", | ||
"indexes": "test/firestore.indexes.json" | ||
}, | ||
"storage": { | ||
"rules": "test/storage.rules" | ||
}, | ||
"functions": { | ||
"source": "test/functions" | ||
}, | ||
"emulators": { | ||
"auth": { | ||
"port": 9099 | ||
}, | ||
"functions": { | ||
"port": 5001 | ||
}, | ||
"firestore": { | ||
"port": 8080 | ||
}, | ||
"database": { | ||
"port": 9000 | ||
}, | ||
"storage": { | ||
"port": 9199 | ||
}, | ||
"ui": { | ||
"enabled": true | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* @license | ||
* Copyright 2018 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
/* eslint-disable @typescript-eslint/no-floating-promises */ | ||
|
||
import firebase from 'firebase/app'; | ||
import 'firebase/auth'; | ||
import { default as TEST_PROJECT, authEmulatorPort } from './config'; | ||
|
||
const rando = (): string => Math.random().toString(36).substring(5); | ||
|
||
describe('RxFire Auth', () => { | ||
let app: firebase.app.App; | ||
let auth: firebase.auth.Auth; | ||
|
||
/** | ||
* Each test runs inside it's own app instance and the app | ||
* is deleted after the test runs. | ||
* | ||
* Each test is responsible for seeding and removing data. Helper | ||
* functions are useful if the process becomes brittle or tedious. | ||
* Note that removing is less necessary since the tests are run | ||
* against the emulator. | ||
*/ | ||
beforeEach(() => { | ||
app = firebase.initializeApp(TEST_PROJECT, rando()); | ||
auth = app.auth(); | ||
auth.useEmulator(`http://localhost:${authEmulatorPort}`); | ||
}); | ||
|
||
afterEach(() => { | ||
app.delete().catch(); | ||
}); | ||
|
||
describe('fromTask', () => { | ||
it('should work', () => { | ||
expect('a').toEqual('a'); | ||
}) | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"rules": { | ||
".read": true, | ||
".write": true | ||
} | ||
} |
Oops, something went wrong.