fix: Decouple cloud sync from telemetry (#343)

This commit is contained in:
Abhisek Datta
2026-06-17 16:03:26 +05:30
committed by GitHub
parent baf637be97
commit 55f3f2a252
5 changed files with 10 additions and 31 deletions
+9 -9
View File
@@ -83,6 +83,15 @@ func TestMaybeSpawnBackgroundSyncSpawnsByDefault(t *testing.T) {
assert.NotEmpty(t, rec.calls[0].name, "spawned name should be a resolved binary path")
}
func TestMaybeSpawnBackgroundSyncIgnoresTelemetryDisabled(t *testing.T) {
rec := withMockSpawner(t)
cfg := newAutoSyncConfig(t)
cfg.Config.DisableTelemetry = true
MaybeSpawnBackgroundSync(cfg)
assert.Equal(t, 1, rec.callCount())
}
func TestMaybeSpawnBackgroundSyncShortCircuits(t *testing.T) {
t.Run("nil config", func(t *testing.T) {
rec := withMockSpawner(t)
@@ -108,15 +117,6 @@ func TestMaybeSpawnBackgroundSyncShortCircuits(t *testing.T) {
assert.Equal(t, 0, rec.callCount())
})
t.Run("telemetry disabled via config", func(t *testing.T) {
rec := withMockSpawner(t)
cfg := newAutoSyncConfig(t)
cfg.Config.DisableTelemetry = true
MaybeSpawnBackgroundSync(cfg)
assert.Equal(t, 0, rec.callCount())
})
t.Run("we are the sync-background child", func(t *testing.T) {
rec := withMockSpawner(t)
cfg := newAutoSyncConfig(t)