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
1 change: 1 addition & 0 deletions workers/events/src/eventContract.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Generated from scient-desktop/packages/scient-analytics/src/wireContract.ts. Do not edit here.
// Scient desktop wire contract. The website gateway consumes a generated copy.
export const ANALYTICS_CONTRACT_REVISION = "4" as const;
export const PRIVACY_LEVELS = ["essential", "product", "diagnostic", "contribution"] as const;

export type PrivacyLevel = (typeof PRIVACY_LEVELS)[number];
Expand Down
2 changes: 1 addition & 1 deletion workers/events/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ describe("event gateway routes", () => {
expect(response.status).toBe(200);
expect(await response.json()).toMatchObject({
status: "ready",
contract_revision: "3",
contract_revision: "4",
worker_version: "unavailable",
worker_version_tag: null,
worker_version_created_at: null,
Expand Down
9 changes: 7 additions & 2 deletions workers/events/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { eventContractViolation, PRIVACY_LEVELS, type PrivacyLevel } from "./eventContract";
import {
ANALYTICS_CONTRACT_REVISION,
eventContractViolation,
PRIVACY_LEVELS,
type PrivacyLevel,
} from "./eventContract";
import { posthogEventUuid, posthogRequest, readBoundedJson, TransportFailure } from "./transport";
import { withExportLease } from "./exportLease";

Expand Down Expand Up @@ -1166,7 +1171,7 @@ const worker: ExportedHandler<AnalyticsEnv> = {
return jsonResponse(
{
status: storageReady ? "ready" : "degraded",
contract_revision: "3",
contract_revision: ANALYTICS_CONTRACT_REVISION,
worker_version: env.CF_VERSION_METADATA?.id ?? "unavailable",
worker_version_tag: env.CF_VERSION_METADATA?.tag ?? null,
worker_version_created_at: env.CF_VERSION_METADATA?.timestamp ?? null,
Expand Down