Skip to content

fix(checkincache): remove stray debug fmt.Println in GetFeatureFlag#1786

Open
munzzyy wants to merge 1 commit into
ooni:masterfrom
munzzyy:fix/remove-debug-println-checkincache
Open

fix(checkincache): remove stray debug fmt.Println in GetFeatureFlag#1786
munzzyy wants to merge 1 commit into
ooni:masterfrom
munzzyy:fix/remove-debug-println-checkincache

Conversation

@munzzyy

@munzzyy munzzyy commented Jul 5, 2026

Copy link
Copy Markdown

Checklist

  • I have read the contribution guidelines
  • reference issue for this pull request: panic: cannot run experiment: no URLs returned #1785
  • if you changed anything related to how experiments work and you need to reflect these changes in the ooni/spec repository, please link to the related ooni/spec pull request: N/A
  • if you changed code inside an experiment, make sure you bump its version number: N/A, not an experiment

Description

Removes a leftover debug fmt.Println(wrapper) in GetFeatureFlag (internal/checkincache/checkincache.go). It was added in #1707 and prints the raw check-in flags struct to stdout on every call, which in practice means every time an experiment checks whether it's enabled.

This is what's behind the confusing unlabeled lines in the log attached to #1785:

{2026-06-25 14:20:32.315561414 +0000 UTC map[openvpn_enabled:false torsf_enabled:false vanilla_tor_enabled:true]}
{2026-06-25 14:20:32.315561414 +0000 UTC map[openvpn_enabled:false torsf_enabled:false vanilla_tor_enabled:true]}

Nothing in the codebase reads this output, it's not part of any structured logging path, and it made the reporter think vanilla_tor had run instead of web_connectivity, when really it's just the check-in cache being printed twice because GetFeatureFlag gets called twice for that run.

I want to be upfront that this doesn't fix the panic in that same log (no URLs returned). That comes from runtimex.PanicOnError in internal/cmd/miniooni/runx.go, which panics when the check-in API returns zero URLs for the experiment. That looks like a backend/check-in condition, not something this file controls, so I'm leaving it out of scope here rather than guessing at a fix I can't verify.

Testing

The change is a one-line deletion of an unused-anywhere debug statement, so there's no new behavior to cover. fmt is still imported and used (fmt.Sprintf in ExperimentEnabledKey), and I checked checkincache_test.go to confirm none of the existing tests assert on stdout, so this shouldn't affect them.

I don't have a Go toolchain set up in the environment I used to prepare this, so I wasn't able to run go test/go vet myself here — I did read through the diff and the surrounding file carefully instead. Happy to fix anything CI turns up.

This debug print was left in by ooni#1707 and runs on every feature-flag
read, printing the raw checkInFlagsWrapper struct to stdout. It shows
up in miniooni/ooniprobe output as an unlabeled line like:

  {2026-06-25 14:20:32 +0000 UTC map[vanilla_tor_enabled:true ...]}

which is confusing on its own and was reported in ooni#1785
as making it look like the wrong experiment had run.
@munzzyy munzzyy requested review from DecFox and hellais as code owners July 5, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant