Skip to content

Make clearPersistence() publicly available #455

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

Merged
merged 4 commits into from
Jun 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions firebase-firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
- [fixed] Updated gRPC to 1.21.0. A bug in the prior version would occasionally
cause a crash if a network state change occurred concurrently with an RPC.
(#428)
- [feature] Added `clearPersistence()`, which clears the persistent storage
including pending writes and cached documents. This is intended to help
write reliable tests (https://github.com/firebase/firebase-js-sdk/issues/449).


# 19.0.1
- [fixed] Fixed an issue that prevented schema migrations for clients with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,8 @@ public static void setLoggingEnabled(boolean loggingEnabled) {
* @return A Task that is resolved once the persistent storage has been cleared. Otherwise, the
* Task is rejected with an error.
*/
Task<Void> clearPersistence() {
@PublicApi
public Task<Void> clearPersistence() {
final TaskCompletionSource<Void> source = new TaskCompletionSource<>();
asyncQueue.enqueueAndForget(
() -> {
Expand Down