Bug 1410145 - Fix wrong version field in android sync ping. r?Grisha
MozReview-Commit-ID: 1Q4Dz7g5QPA
--- a/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetrySyncPingBundleBuilder.java
+++ b/mobile/android/base/java/org/mozilla/gecko/telemetry/pingbuilders/TelemetrySyncPingBundleBuilder.java
@@ -23,29 +23,32 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
/**
* Responsible for building a Sync Ping, based on the telemetry docs:
* https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/data/sync-ping.html
*
+ * Fields common to all pings are documented here:
+ * https://firefox-source-docs.mozilla.org/toolkit/components/telemetry/telemetry/data/common-ping.html
+ *
* This builder takes two stores ('sync' and 'event') and produces a single "sync ping".
*
* Note that until Bug 1363924, event telemetry will be ignored.
*
* Sample result will look something like:
* {
* "syncs": [list of syncs, as produced by the SyncBuilder],
* "events": [list of events, as produced by the EventBuilder]
* }
*/
public class TelemetrySyncPingBundleBuilder extends TelemetryPingBuilder {
private static final String PING_TYPE = "sync";
- private static final int PING_BUNDLE_VERSION = 5; // Bug 1374758
+ private static final int PING_BUNDLE_VERSION = 4; // Bug 1410145
private static final int PING_SYNC_DATA_FORMAT_VERSION = 1; // Bug 1374758
public static final String UPLOAD_REASON_FIRST = "first";
public static final String UPLOAD_REASON_CLOCK_DRIFT = "clockdrift";
public static final String UPLOAD_REASON_SCHEDULE = "schedule";
public static final String UPLOAD_REASON_IDCHANGE = "idchange";
public static final String UPLOAD_REASON_COUNT = "count";
--- a/mobile/android/tests/background/junit4/src/org/mozilla/gecko/telemetry/pingbuilders/TelemetrySyncPingBundleBuilderTest.java
+++ b/mobile/android/tests/background/junit4/src/org/mozilla/gecko/telemetry/pingbuilders/TelemetrySyncPingBundleBuilderTest.java
@@ -107,17 +107,17 @@ public class TelemetrySyncPingBundleBuil
builder.setSyncEventStore(eventPings);
TelemetryOutgoingPing outgoingPing = builder.build();
assertTrue(outgoingPing.getPayload().containsKey("application"));
assertTrue(outgoingPing.getPayload().containsKey("payload"));
assertTrue(outgoingPing.getPayload().containsKey("id"));
assertEquals("sync", outgoingPing.getPayload().getString("type"));
- assertEquals(Integer.valueOf(5), outgoingPing.getPayload().getIntegerSafely("version"));
+ assertEquals(Integer.valueOf(4), outgoingPing.getPayload().getIntegerSafely("version"));
// Test application key.
ExtendedJSONObject application = outgoingPing.getPayload().getObject("application");
assertEquals("Mozilla", application.getString("vendor"));
assertTrue(application.containsKey("architecture"));
assertTrue(application.containsKey("platformVersion"));
assertTrue(application.containsKey("displayVersion"));
assertTrue(application.containsKey("version"));