Repository navigation
Telemetry: hold sign-in events until the consent question is answered - #367
Merged
Merged
Conversation
The signin.started/completed/failed/cancelled usage events have been dropped on every release since 0.7.0. A sign-in always happens before the consent question is asked, and sign-out resets the decision to unanswered, so the allows_usage() gate in diag::event discarded the whole funnel. 0.6.x fixed this (issue #75) by holding a bounded, memory-only, sign-in-only set of events while consent is unanswered and replaying them with their original timestamp and session id once the person answers. That code lived only on release/v0.6 and was not carried over by the 0.7 forward-port (#105). Port just the diag deferral: Stamp, defer, replay_deferred, clear_deferred, DEFERRED_CAP = 8. commit_live replays after publishing the decision, so a "yes" sends the held events and a "no" drops them; forget_live clears, so a held event never crosses to the next account. An answered "no" stays dropped. No boot-time replay: activate_initial publishes the decision before the session adapter can emit a sign-in event. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GLinnik21
added a commit
that referenced
this pull request
Oct 1, 2026
…nt only on a yes (#373) #367 holds the sign-in usage events from before the consent answer in memory and sends them only after a yes to product analytics. PRIVACY.md and the in-app Privacy text (en, es, be) now say so: every attempt before the answer is covered, at most the eight most recent events, discarded on a no, on sign-out, or when the app closes first. Text only. POLICY_VERSION and the consent scopes are untouched, so nobody is asked again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The
signin.started/signin.completed/signin.failed/signin.cancelledusage events have been dropped on every release since 0.7.0. A sign-in always happens before the consent question is asked, and sign-out resets the decision to unanswered, so theallows_usage()gate indiag::eventdiscarded the whole funnel.0.6.x fixed this (issue #75) by holding sign-in events while consent is unanswered. That code lived only on
release/v0.6and was not carried over by the 0.7 forward-port (#105). This ports just that deferral ontomain:commit_live), the held events are replayed through the ordinary gate with their original timestamp and session id. A "yes" to usage analytics sends them; a "no" drops them.forget_live) drop them unreplayed, so a held event never crosses to the next account.activate_initialpublishes the decision before the session adapter can emit a sign-in event.Files:
rust-modules/src/diag/mod.rs,rust-modules/src/app/adapters/consent.rs.No GitHub issue exists for this regression, so there is no closing link.
Tests (written failing first, now passing)
In
diag::tests, watched failing with the hold disabled:a_signin_event_before_the_consent_answer_is_held_and_replayed_with_its_original_stampclear_deferred_drops_whatever_was_heldreplay_with_consent_still_unanswered_empties_the_queue_without_redeferringthe_deferred_queue_is_cappedPlus: an answered "no" holds nothing, a non-sign-in event is never held, a replayed stamp without a session id is dropped, and at the seam
app::adapters::consent::tests::commit_live_replays_held_signin_events_and_forget_live_drops_them.Gates
On the committed tree of the code change (
git status --shortempty before and after):make check, exit 0:test result: ok. 5433 passed; 0 failed; 7 ignored; 0 measured; 0 filtered out; finished in 57.13stest result: ok. 102 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.15stest result: ok. 5513 passed; 0 failed; 7 ignored; 0 measured; 0 filtered out; finished in 57.56sCARGO_INCREMENTAL=0 cargo +nightly check --manifest-path rust-modules/Cargo.toml --lib --no-default-features: clean.make(ARM cross-build): exit 0.A doc-claim audit then corrected two comments this change had added. On that final tree only the targeted run and the feature check were repeated; the full
make checkwas not re-run after the comment-only edit:cargo +nightly test --lib -- diag:::test result: ok. 59 passed; 0 failed; 0 ignored; 0 measured; 5381 filtered out; finished in 0.24s--no-default-featurescheck: clean.Host-only change; no FFI, UI or device behaviour touched, so no TV verification.
Not proven here
signin.*events arriving from a build that ships this.Known leftovers (out of scope)
PRIVACY.mdand the in-app Privacy text are unchanged. Nothing in them is made false, but they do not mention that sign-in activity from before the answer is sent after a "yes". Whether to add a sentence is left to the owner.startedis evicted, so a replayedfailedcan arrive without itsstarted.Redirectguard inconsent.rs; a shared helper would touch three existing tests.🤖 Generated with Claude Code