Ionic 4 IOS FIRESTORE 内部断言失败:AsyncQueue 已经失败:在索引数据库服务器中遇到内部错误
Ionic 4 IOS FIRESTORE INTERNAL ASSERTION FAILED: AsyncQueue is already failed: An internal error was encountered in the Indexed Database server
我正在开发一个 Ionic 应用程序,我使用 Firestore 作为数据库,使用离线模式。
import {AngularFirestoreModule} from '@ angular / fire / Firestore';
AngularFirestoreModule.enablePersistence (),
当我打开应用程序时,一切都运行良好,即使在离线模式下也是如此。
但是,如果应用程序在重新打开时以后台模式保持打开状态,它总是会提示此错误:
FIRESTORE (6.2.4) INTERNAL ASSERTION FAILED: AsyncQueue is already
failed: An internal error was encountered in the Indexed Database
server.
而且我无法再在应用程序中的任何地方导航,因为我的条件是订阅一直有效,直到组件被销毁(当我更改页面时发生这种情况)
takeUntil (componentDestroyed (this)):
我收到以下错误:
"1 errors occurred during unsubscription: 1) Error: FIRESTORE (6.2.4)
INTERNAL ASSERTION FAILED: AsyncQueue is already failed: An internal
error was encountered in the Indexed Database server"
而且整个应用程序停止工作,不得不关闭它并重新打开它非常烦人。
有什么不同的做法吗?我已经查看了 Whosebug,Github,所有 google,但我找不到任何解决方案。
我看到其他应用程序(如 Netflix、HBO 等)所做的。是,当您重新打开应用程序时,它并没有完全从它停留的位置开始,它会警告您它正在加载,并且当它完成加载时,它会让您非常接近离开应用程序之前没有 activity 的位置。我想它有一个背景和前景变化检测器以及每个事件的函数。
我在想用离子循环我可以解决这个问题,比如:
-检测后台的变化,如果前台有任何变化,取消订阅并重新订阅。
你知道其他的做法吗?
我解决的那个错误:
window.onerror = function(error) {
if (error.indexOf("An internal error was encountered in the Indexed Database server") >= 0) {
// Refresh the page to restore IndexedDb to a working state.
window.location.reload();
}
};
以及如何观察背景和前景的状态变化:
import { Platform } from 'ionic-angular';
@Component({
template: `OK`
})
constructor(public platform: Platform) {
platform.ready().then(() => {
if (platform.is('cordova')){
//Subscribe on pause
this.platform.pause.subscribe(() => {
//Hello pause
});
//Subscribe on resume
this.platform.resume.subscribe(() => {
window['paused'] = 0;
});
}
});
}
希望他们为您问好。
我正在开发一个 Ionic 应用程序,我使用 Firestore 作为数据库,使用离线模式。
import {AngularFirestoreModule} from '@ angular / fire / Firestore';
AngularFirestoreModule.enablePersistence (),
当我打开应用程序时,一切都运行良好,即使在离线模式下也是如此。 但是,如果应用程序在重新打开时以后台模式保持打开状态,它总是会提示此错误:
FIRESTORE (6.2.4) INTERNAL ASSERTION FAILED: AsyncQueue is already failed: An internal error was encountered in the Indexed Database server.
而且我无法再在应用程序中的任何地方导航,因为我的条件是订阅一直有效,直到组件被销毁(当我更改页面时发生这种情况)
takeUntil (componentDestroyed (this)):
我收到以下错误:
"1 errors occurred during unsubscription: 1) Error: FIRESTORE (6.2.4) INTERNAL ASSERTION FAILED: AsyncQueue is already failed: An internal error was encountered in the Indexed Database server"
而且整个应用程序停止工作,不得不关闭它并重新打开它非常烦人。
有什么不同的做法吗?我已经查看了 Whosebug,Github,所有 google,但我找不到任何解决方案。 我看到其他应用程序(如 Netflix、HBO 等)所做的。是,当您重新打开应用程序时,它并没有完全从它停留的位置开始,它会警告您它正在加载,并且当它完成加载时,它会让您非常接近离开应用程序之前没有 activity 的位置。我想它有一个背景和前景变化检测器以及每个事件的函数。
我在想用离子循环我可以解决这个问题,比如: -检测后台的变化,如果前台有任何变化,取消订阅并重新订阅。
你知道其他的做法吗?
我解决的那个错误:
window.onerror = function(error) {
if (error.indexOf("An internal error was encountered in the Indexed Database server") >= 0) {
// Refresh the page to restore IndexedDb to a working state.
window.location.reload();
}
};
以及如何观察背景和前景的状态变化:
import { Platform } from 'ionic-angular';
@Component({
template: `OK`
})
constructor(public platform: Platform) {
platform.ready().then(() => {
if (platform.is('cordova')){
//Subscribe on pause
this.platform.pause.subscribe(() => {
//Hello pause
});
//Subscribe on resume
this.platform.resume.subscribe(() => {
window['paused'] = 0;
});
}
});
}
希望他们为您问好。