File tree 2 files changed +9
-3
lines changed 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @firebase/app ' : patch
3
+ ---
4
+
5
+ Catch more heartbeat read/write errors.
Original file line number Diff line number Diff line change @@ -62,10 +62,11 @@ export async function readHeartbeatsFromIndexedDB(
62
62
) : Promise < HeartbeatsInIndexedDB | undefined > {
63
63
try {
64
64
const db = await getDbPromise ( ) ;
65
- return db
65
+ const result = await db
66
66
. transaction ( STORE_NAME )
67
67
. objectStore ( STORE_NAME )
68
- . get ( computeKey ( app ) ) as Promise < HeartbeatsInIndexedDB | undefined > ;
68
+ . get ( computeKey ( app ) ) ;
69
+ return result ;
69
70
} catch ( e ) {
70
71
if ( e instanceof FirebaseError ) {
71
72
logger . warn ( e . message ) ;
@@ -87,7 +88,7 @@ export async function writeHeartbeatsToIndexedDB(
87
88
const tx = db . transaction ( STORE_NAME , 'readwrite' ) ;
88
89
const objectStore = tx . objectStore ( STORE_NAME ) ;
89
90
await objectStore . put ( heartbeatObject , computeKey ( app ) ) ;
90
- return tx . done ;
91
+ await tx . done ;
91
92
} catch ( e ) {
92
93
if ( e instanceof FirebaseError ) {
93
94
logger . warn ( e . message ) ;
You can’t perform that action at this time.
0 commit comments