{"record":{"id":"7bbd679cafa3bcb5","repo":"Hmbown/CodeWhale","slug":"telemetry-permission-is-no-longer-enabled","errorCode":null,"errorMessage":"telemetry permission is no longer enabled","messagePattern":"telemetry permission is no longer enabled","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"crates/telemetry/src/buffer.rs","lineNumber":469,"sourceCode":"/// permitted.\n///\n/// Called by `init` on every arming. Both the exact tombstone generation and a\n/// fresh durable permission check must still match while the wipe lock is held.\n/// A stale buffer left by an earlier run or by a bug cannot enter the new\n/// process's batch.\npub(crate) fn arm(\n    root: &Path,\n    observed_generation: Option<&TombstoneGeneration>,\n    permission_still_enabled: impl FnOnce() -> bool,\n) -> Result<()> {\n    ensure_dir(root)?;\n    with_lock(root, || {\n        let current_generation = tombstone_generation(root)?;\n        if current_generation.as_ref() != observed_generation {\n            anyhow::bail!(\"telemetry permission changed before arming\");\n        }\n        if !permission_still_enabled() {\n            anyhow::bail!(\"telemetry permission is no longer enabled\");\n        }\n        let tombstone = tombstone_path(root);\n        if tombstone.exists() {\n            fs::remove_file(&tombstone)\n                .with_context(|| format!(\"failed to remove {}\", tombstone.display()))?;\n        }\n        truncate(&buffer_path(root))\n    })\n}\n","sourceCodeStart":451,"sourceCodeEnd":479,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/telemetry/src/buffer.rs#L451-L479","documentation":"arm() takes a permission_still_enabled callback and re-checks it under the privacy lock after validating the tombstone generation. If the user's telemetry permission was turned off between the initial consent and arming, the operation bails with this error so arming never overrides a revoked permission.","triggerScenarios":"arm(root, observed_generation, permission_still_enabled) is invoked while the callback returns false — the config setting or runtime flag enabling telemetry flipped to off after consent was captured.","commonSituations":"User disabled telemetry in config while the app was starting; config file reloaded concurrently flipping the flag; another instance wrote settings.telemetry=false; scripted toggling of the setting during automation.","solutions":["Respect the revocation: skip arming and reload config to confirm the current setting.","If the flip was unintentional, re-enable the telemetry setting in config and retry.","Re-read the permission immediately before arming so the check reflects the latest config.","Avoid concurrently editing the config while the app arms telemetry."],"exampleFix":"// before: caching the permission flag at startup\nlet enabled = config.telemetry_enabled;\nlater: arm(root, gen, || enabled)?;\n// after: re-read live config inside the callback\narm(root, gen, || config_snapshot().telemetry_enabled)?;","handlingStrategy":"validation","validationCode":"// Read the live setting right before arming\nlet enabled = config.reload()?.telemetry_enabled;\nanyhow::ensure!(enabled, \"telemetry permission is off; do not arm\");","typeGuard":"fn permission_is_live(config: &Config) -> bool { config.telemetry_enabled }","tryCatchPattern":"match arm(root, gen, || live_permission()) {\n    Err(e) if e.to_string().contains(\"no longer enabled\") => {\n        log::info!(\"telemetry was disabled mid-arm; skipping\");\n        // do not retry; respect the revocation\n    }\n    r => r?,\n}","preventionTips":["Pass a callback that re-reads config, never a cached bool","Do not edit the telemetry setting while the app is arming","Reload config after any external modification before arming","Log permission revocations so behavior is auditable"],"tags":["telemetry","permission","config"],"backgroundTag":"feature-not-enabled","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}