Skip to content

Commit 8aca8fb

Browse files
authored
Merge e6b709d into ff1a6ec
2 parents ff1a6ec + e6b709d commit 8aca8fb

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/chilly-emus-sit.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/app': patch
3+
---
4+
5+
App - provide a more robust check to cover more cases of empty heartbeat data.

packages/app/src/heartbeatService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export class HeartbeatServiceImpl implements HeartbeatService {
8888
// service, not the browser user agent.
8989
const agent = platformLogger.getPlatformInfoString();
9090
const date = getUTCDateString();
91-
if (this._heartbeatsCache === null) {
91+
if (this._heartbeatsCache?.heartbeats == null) {
9292
this._heartbeatsCache = await this._heartbeatsCachePromise;
9393
}
9494
// Do not store a heartbeat if one is already stored for this day
@@ -128,7 +128,7 @@ export class HeartbeatServiceImpl implements HeartbeatService {
128128
}
129129
// If it's still null or the array is empty, there is no data to send.
130130
if (
131-
this._heartbeatsCache === null ||
131+
this._heartbeatsCache?.heartbeats == null ||
132132
this._heartbeatsCache.heartbeats.length === 0
133133
) {
134134
return '';

0 commit comments

Comments
 (0)