Repository navigation
feat(diagnostics): expand client log attribute registry - #649
Merged
Merged
Conversation
Adds the attribute keys the Apple and Android clients need to record startup, network, auth, and playback behavior in diagnostics reports. The four playback keys were already being emitted by the Apple client but were never registered here, so they were silently dropped by this collector and hard-rejected by the hosted one. Registering them makes the canonical registry the superset it was always meant to be. position_seconds is deliberately registered as position_ms (integer): attrValueType has only string and integer, and a millisecond ordinal avoids adding a float type for a single key. launch_type is a string for the same reason, rather than a bool. New keys: playback: session_id, play_method, reason, position_ms lifecycle: phase, duration_ms, outcome, reason, launch_type network: outcome, error_code, attempt Purely additive; no existing key changes type or is removed. TestAttrRegistryStaysInSync keeps the Go map and the JSON in lockstep. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe diagnostics schema and Go contract now register additional playback, network, and lifecycle attributes, including session data, outcomes, error classifications, retry attempts, durations, and launch types. ChangesDiagnostics contract expansion
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR adds diagnostic attribute registrations without changing or removing existing keys, and no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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.
Why
The Apple and Android clients are gaining substantial diagnostics instrumentation for startup, network, auth, and playback behavior. Those attributes have to be registered here first — this repo is the canonical source for the client diagnostics attribute registry.
This PR is also a bug fix. The Apple client has been emitting four playback attributes that were never registered here:
unregistered_log_attribute, which becomes aPermanentBundleErrorand marks the entire reportrejected.Making the canonical registry the superset fixes both.
Changes
Purely additive. No existing key changes type or is removed.
playbacksession_id,play_method,reason,position_mslifecyclephase,duration_ms,outcome,reason,launch_typenetworkoutcome,error_code,attemptTwo type decisions worth reviewing
attrValueTypehas onlyattrStringandattrInteger. Rather than add type machinery for two keys:position_seconds(float) →position_ms(integer). The Apple emission site converts, clamping non-finite/negative to 0 and saturating atInt.max.cold(bool) →launch_type(string). Values"cold"/"warm".If you'd rather have a float/bool type in the registry, say so and I'll rework it — this was chosen to keep the collector simple.
Note for reviewers
playback.session_idandnetwork.attemptare valid registry keys but also appear in silo-diagnostics'privacy.tsFORBIDDEN_KEYS. A hosted bundle carrying them fails theprivacy_fieldscheck while still processing toready. Both clients therefore withhold them from hosted bundles; self-hosted reports keep them. That's handled client-side and needs nothing here.Deployment ordering
This must ship before the clients. Self-hosted servers running the old
contract.gowill silently drop the new attributes, so the evidence just won't appear in self-hosted reports until they update. No breakage, but worth knowing.Testing
TestAttrRegistryStaysInSynckeeps the Go map and the JSON in lockstep — it's the reason the drift was caught.go test -count=1 ./internal/diagnostics/...passes;go build ./...clean.Related
🤖 Generated with Claude Code
Summary by CodeRabbit