Attempt to get a record from database without an in-progress transaction
- Lingua principale
- TypeScript
- Stelle
- 7.8k
- Fork
- 2.2k
- Merge medio
- 22h 28m
- PR unite (30g)
- 6
Descrizione
### Version info
**Angular:** 14.2.8
**Firestore:** 9.15.0
**AngularFire:** 7.5.0
**Ionic:** 6.1.9
**iOS:** 16.1.1 iPhoneSE (error also happens on newer versions)
### How to reproduce these conditions
**Steps to set up and reproduce**
* Setup of `app.module.ts`:
```typescript
// ...
import { initializeApp, provideFirebaseApp } from '@angular/fire/app';
import { AngularFireAuthModule } from '@angular/fire/compat/auth';
import { FirestoreService } from './services/firestore.service';
import { AngularFireModule } from '@angular/fire/compat';
import { AngularFirestoreModule } from '@angular/fire/compat/firestore';
@NgModule({
declarations: [
AppComponent // ...
],
imports: [
// ...
IonicModule.forRoot(),
// ...
AngularFireModule.initializeApp(environment.firebase),
AngularFireAuthModule,
AngularFirestoreModule.enablePersistence(),
provideFirebaseApp(() => initializeApp(environment.firebase)),
],
providers: [
FirestoreService,
// ...
],
bootstrap: [AppComponent],
})
export class AppModule {}
```
* sync build to ios device
* lock screen (it's hard to actually reproduce)
### Debug output
```
[Error] [2023-04-25T07:19:43.604Z] @firebase/firestore: – "Firestore (9.15.0): INTERNAL UNHANDLED ERROR: " – "Attempt to get a record from database without an in-progress transaction"
error
defaultLogHandler (vendor.js:231226)
error (vendor.js:231332)
x (vendor.js:40775)
(anonymous function) (vendor.js:62299)
(anonymous function) (polyfills.js:300)
(anonymous function) (polyfills.js:1720)
(anonymous function) (polyfills.js:357)
drainMicroTaskQueue (polyfills.js:827)
(anonymous function) (polyfills.js:705)
invokeTask (polyfills.js:2220)
globalCallback (polyfills.js:2257)
[Error] [2023-04-25T07:20:21.926Z] @firebase/firestore: – "Firestore (9.15.0): FIRESTORE (9.15.0) INTERNAL ASSERTION FAILED: Unexpected state"
error
defaultLogHandler (vendor.js:231226)
error (vendor.js:231332)
x (vendor.js:40775)
O (vendor.js:40859)
zc (vendor.js:62312)
enqueue (vendor.js:62217)
enqueueAndForget (vendor.js:62200)
handleDelayElapsed (vendor.js:58208)
timer (polyfills.js:3714)
onInvokeTask (vendor.js:197041)
(anonymous function) (polyfills.js:357)
(anonymous function) (polyfills.js:702)
```
### Actual behavior
After the screen gets locked on an iOS device, Firestore gets into an unexpected state and none of the Angular routes that use firebase queries can be accessed anymore. We only query data of our firebase instance, so there shouldn't be transaction issues.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia dalla configurazione di app.module.ts, in particolare AngularFirestoreModule.enablePersistence(), e riproduci il problema su un dispositivo iOS bloccando lo schermo. Confronta gli errori di Firestore 9.15.0 con le route Angular interessate e l’utilizzo di FirestoreService; il lavoro è completato quando gli errori interni non rendono più inutilizzabili le query Firebase e le route dopo lo sblocco.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- angular, firebase, ios, typescript
- Ambito
- database, mobile
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 30/100