Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

[Full changelog](https://github.com/mozilla/glean.js/compare/v0.11.0...main)

* [#279](https://github.com/mozilla/glean.js/pull/279): BUGFIX: Ensure only empty pings triggers logging of "empty ping" messages.

# v0.11.0 (2021-05-03)

[Full changelog](https://github.com/mozilla/glean.js/compare/v0.10.2...v0.11.0)
Expand Down
9 changes: 5 additions & 4 deletions glean/src/core/pings/maker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,11 @@ export function getPingHeaders(debugOptions?: DebugOptions): Record<string, stri
export async function collectPing(metricsDatabase: MetricsDatabase, eventsDatabase: EventsDatabase, ping: CommonPingData, reason?: string): Promise<PingPayload | undefined> {
const metricsData = await metricsDatabase.getPingMetrics(ping.name, true);
const eventsData = await eventsDatabase.getPingEvents(ping.name, true);
if (!metricsData && !eventsData && !ping.sendIfEmpty) {
console.info(`Storage for ${ping.name} empty. Bailing out.`);
return;
} else if (!metricsData) {
if (!metricsData && !eventsData) {
if (!ping.sendIfEmpty) {
console.info(`Storage for ${ping.name} empty. Bailing out.`);
return;
}
console.info(`Storage for ${ping.name} empty. Ping will still be sent.`);
}

Expand Down