Skip to content

Plan: Performance Monitoring custom traces#105

Draft
code418 wants to merge 5 commits into
masterfrom
plan/performance-traces
Draft

Plan: Performance Monitoring custom traces#105
code418 wants to merge 5 commits into
masterfrom
plan/performance-traces

Conversation

@code418
Copy link
Copy Markdown
Owner

@code418 code418 commented Apr 25, 2026

Draft plan for the 'performance-traces' feature.

See docs/plans/performance-traces.md for 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.

code418 and others added 5 commits April 24, 2026 17:36
_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>
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