Repository navigation
fix(cbio): render the closed GS1 phase, not the driver's status text - #169
Closed
shroominic wants to merge 1 commit into
Closed
shroominic wants to merge 1 commit into
shroominic wants to merge 1 commit into
Conversation
Merging this lane into the sensor aggregate broke openhealth/test/session_sync_failure_test.dart, the guard for the bounded session-sync failure contract (#133/#134): the connection screen started passing CgmSessionSnapshot.statusText straight into the progress card for every cbio snapshot, so a session that never decoded rendered the driver's internal string ('Listening for notifications' in the guard) instead of the stage label 'Syncing sensor history' the contract asserts. That is a surface regression beyond the guard: statusText is unbounded and internal, and the screen deliberately renders a closed set of user-facing strings for every other driver. Map the closed phase in cbioPhaseMetadataKey (connecting, authenticating, history, live, disconnected) to product copy instead, and fall through to the generic stage label when the phase is absent or the snapshot is not cbio. The guard is untouched. New coverage: a presentation test for the mapping and a widget test that drives the real connect button and asserts the bounded-sync stage label is shown and the driver's text is not. Refs #162
Owner
Author
|
Carried by the GS1 consolidation in PR #209 (branch feature/cbio-gs1, head 3eca4f4). This PR is contained in the consolidated line; the merge that carries it is c85f827. Closing as subsumed by the consolidation - not as won't fix. The per-defect evidence stays in this thread, and the carrying commit above is where the change now lives. |
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.
Closes #162.
Reproduction (red)
Same failure reproduced on this branch alone (with the pre-fix getter restored)
so the RED is attributable to this lane, not to the aggregate.
Root cause
It is a surface regression, not a timing or metadata problem.
_ConnectionProgressrendersstatusText ?? phaseText. Before this lane theconnection screen passed no
statusText, so a syncing session rendered theclosed stage label
_connectionStageText(CgmSyncStage.syncing)='Syncing sensor history'.This lane added
statusText: _cbioProgressText, which returnedCgmSessionSnapshot.statusTextverbatim for every cbio snapshot. Thebounded-failure guard's session publishes
statusText: 'Listening for notifications', so the card rendered that instead and the contract's visiblestage label disappeared.
Two things make the new behaviour wrong beyond the guard:
statusTextis an internal, unbounded field. Every other driver in thisscreen renders a closed set of product strings; this was the only path that
put a raw driver string on a user surface.
cbioPhaseMetadataKeyin {connecting,authenticating,history,live,disconnected} - so the intent did not need the unbounded field at all.Fix
cbioProgressTextForSnapshotinsession_presentation.dartmaps the closedphase to product copy and returns
nullfor anything else.the generic stage label exactly as before this lane.
expectation is not weakened, skipped, or reworded.
Verification
flutter test test/session_sync_failure_test.darton the aggregate (release/v0.4.0 + app-live + this fix)+5: All tests passed!flutter teston the aggregate (full openhealth unit suite)+491: All tests passed!flutter testinpackages/cgm_cbioon the aggregate+86: All tests passed!flutter test test/cbio_app_surface_test.darton this branch, pre-fix getterFound 0 widgets with text "Syncing sensor history"flutter test test/cbio_app_surface_test.darton this branch, fixed+8: All tests passed!flutter analyze(openhealth)New coverage: a presentation test for the mapping, and a widget test that drives
the real connect button and asserts the bounded-sync stage label is shown while
the driver's raw text is not.
Merge note for the aggregate
The fix belongs on this lane because this lane changed the surface. The
aggregate (
release/v0.4.0+ app-live) should merge this branch's tip forancestry; the merge is clean (no conflicts).