[misc] PdfJsMetrics: add a version number to the event segmentation GitOrigin-RevId: 4c5e1df9e3513edbfeae0f47303ce9512a25c118
@@ -1,7 +1,13 @@
import { v4 as uuid } from 'uuid'
import { sendMB } from '../../../infrastructure/event-tracking'
+// VERSION should get incremented when making changes to caching behavior or
+// adjusting metrics collection.
+// Keep in sync with the service worker.
+const VERSION = 2
+
const pdfJsMetrics = {
+ version: VERSION,
id: uuid(),
epoch: Date.now(),
totalBandwidth: 0,
@@ -3,6 +3,7 @@ const OError = require('@overleaf/o-error')
// VERSION should get incremented when making changes to caching behavior or
// adjusting metrics collection.
+// Keep in sync with PdfJsMetrics.
const VERSION = 2
const CLEAR_CACHE_REQUEST_MATCHER = /^\/project\/[0-9a-f]{24}\/output$/