feat: refactor copilot module (#14537)

This commit is contained in:
DarkSky
2026-03-02 13:57:55 +08:00
committed by GitHub
parent 60acd81d4b
commit c5d622531c
92 changed files with 5759 additions and 2170 deletions
@@ -42,8 +42,18 @@ export class Ga4Client {
timestamp_micros: event.timestampMicros,
})),
};
await this.post(payload);
try {
await this.post(payload);
} catch {
if (env.DEPLOYMENT_TYPE === 'affine') {
// In production, we want to be resilient to GA4 failures, so we catch and ignore errors.
// In non-production environments, we rethrow to surface issues during development and testing.
console.info(
'Failed to send telemetry event to GA4:',
chunk.map(e => e.eventName).join(', ')
);
}
}
}
}
}