Plan: Performance Monitoring custom traces#105
Draft
code418 wants to merge 5 commits into
Draft
Conversation
_userDocStream() was invoked directly inside build(), so each rebuild created a new Firestore snapshot subscription. This caused unnecessary reads and a brief "0 pts / 0 claimed" flicker every time the sibling StreamBuilder emitted (e.g. streak change). Cached in a late final field to match the existing _streakStream pattern. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
FuzzyCompassPainter counter-rotates the 'N' marker glyph so it remains readable while its ring position still tracks magnetic north. The wear compass page wrapped the painter in Transform.rotate(-rotation) but didn't forward rotation to the painter, so the N letter spun with the canvas and appeared sideways whenever the watch wasn't facing north. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Cloud Functions serialise JS numbers as either int or double depending on value, so `as int?` throws on a double. wear_claim_page and wear_compass_page both cast counts['total'] (and compass sector values) with `as int?`, which would crash the scan flow on any backend response where the count came through as a double. Normalise via `num?.toInt()` and reconstruct the compass counts map entry-by-entry for the same reason. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…hrows The Nearby and Claim screens assigned counts['total'], pts['max'], cipher counts, and compass sector values (all dynamic, originating from HttpsCallable.data) straight into typed int fields. Cloud Functions can serialise a JS number as either int or double depending on value (e.g. aggregations that go through a divide), so any double would crash the scan with a runtime cast error. Mirror the wear-side fix and normalise via `num?.toInt()`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Draft plan for the 'performance-traces' feature.
See
docs/plans/performance-traces.mdfor the full plan including Firebase services used, data model, rollout, and risks.Part of the Firebase-enhancement suggestion series. No implementation in this PR — planning document only.