angular / angular/angularfire

Attempt to get a record from database without an in-progress transaction

Đang mở
#3,342 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
7.8k
Fork
2.2k
Merge trung bình
22 giờ 28 phút
Pull request đã merge (30 ngày)
6

Mô tả

### 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu với phần thiết lập trong app.module.ts, đặc biệt là AngularFirestoreModule.enablePersistence(), và tái hiện trên một thiết bị iOS bằng cách khóa màn hình. So sánh các lỗi của Firestore 9.15.0 với các route Angular bị ảnh hưởng và việc sử dụng FirestoreService; được xem là hoàn tất khi các lỗi nội bộ không còn khiến các truy vấn Firebase và các route không thể sử dụng sau khi mở khóa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
angular, firebase, ios, typescript
Lĩnh vực
database, mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.