File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
packages/firestore/src/core Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ import { Platform } from '../platform/platform';
31
31
import { Datastore } from '../remote/datastore' ;
32
32
import { User } from '../auth/user' ;
33
33
import { PersistenceSettings } from './firestore_client' ;
34
- import { debugAssert } from '../util/assert' ;
34
+ import { debugAssert , hardAssert } from '../util/assert' ;
35
35
import { GarbageCollectionScheduler , Persistence } from '../local/persistence' ;
36
36
import { Code , FirestoreError } from '../util/error' ;
37
37
import { OnlineStateSource } from './types' ;
@@ -133,10 +133,12 @@ export class MemoryComponentProvider implements ComponentProvider {
133
133
}
134
134
135
135
createPersistence ( cfg : ComponentConfiguration ) : Persistence {
136
- debugAssert (
137
- ! cfg . persistenceSettings . durable ,
138
- 'Can only start memory persistence'
139
- ) ;
136
+ if ( cfg . persistenceSettings . durable ) {
137
+ throw new FirestoreError (
138
+ Code . FAILED_PRECONDITION ,
139
+ MEMORY_ONLY_PERSISTENCE_ERROR_MESSAGE
140
+ ) ;
141
+ }
140
142
return new MemoryPersistence ( MemoryEagerDelegate . factory ) ;
141
143
}
142
144
You can’t perform that action at this time.
0 commit comments