Skip to content

Re-freeze with the NaN fix, re-test the custom-meal path, and settle the scanner #1262

Closed

Description

@simonoppowa

Question

Part of Map: a verified go/no-go for 2.4.0, graduated from the fix-cycle fog by Go or no-go's no-go.

The candidate re-freezes with #1259 (the NaN / zero-base-quantity fix for #1254) included. Does the rebuilt candidate hold up on the one path the delta now touches, and is it ready for the develop → main PR?

Scope is only #1259, plus the changelog and the version bump. #1222, #1223 and #1230 stay out.

  1. Merge fix(edit-meal): stop a zero base quantity from storing NaN nutriments #1259 and #1261 into develop; bump pubspec.yaml to 2.4.0+66 (it is still 2.3.0+65).
  2. Re-freeze at that head, record the SHA, rebuild the full --debug APK (recipe in Build the v2.3.0 and candidate debug APKs…; the scratchpad is tmpfs and does not survive a reboot).
  3. adb install -r over the Pixel 6's existing install — the box still holds the run's fixture (three Open Food Facts intakes, "Testrezept" with its 300 g override, the imported "Vanilla Cake", seven weight entries, one activity).
  4. Re-test the NaN path deliberately, since it is what forced the re-freeze and the original run could not reach it: create a custom meal in Advanced mode with base quantity 0 and every nutrient 0, log it, then check Home, Diary and Trends render — no grey boxes, no Infinity or NaN toInt. Confirm in adb logcat and in a fresh export that no stored total is NaN. Then confirm a day whose totals were already broken renders again (fix(edit-meal): stop a zero base quantity from storing NaN nutriments #1259 claims it rebuilds them).
    The custom-food form defeated the driver last time — no field identifiers, and the keyboard reshuffles positions between taps. Either drive it with a re-dump immediately before every tap and %s-escaped input, or hand the maintainer a short checklist for this one form.
  5. Confirm the migration is still a no-op: the repaired rows must still read 552 / 720 / 0 and the startup log must carry no OffMicronutrientRepair line.
  6. The scanner: the maintainer points the phone at something lit and reopens the barcode scanner, settling the one inconclusive area from the run.

Resolution records: the re-frozen SHA, the NaN re-test result, the migration no-op confirmation, the scanner verdict, and a go or no-go for the develop → main PR.

Activity

  1. simonoppowa commented on Sep 26, 2026

    @simonoppowa
    OwnerAuthor

    Re-freeze done, the device is clean, and the scanner is settled. One item accepted on unit coverage rather than device evidence — stated plainly below.

    What landed

    Step Result
    Merge #1259, #1261; bump All on develop: c55a2ccf (NaN fix), 780a7124 (store notes), 680eafaa (2.4.0+66).
    Re-freeze and rebuild Candidate is 680eafaa; ont-refreeze-680eafaa-full-debug.apk reports versionCode='66' versionName='2.4.0'.
    Upgrade in place Installed over the existing install: firstInstallTime still 2026-09-19, so a true upgrade. The whole fixture survived — four Open Food Facts intakes, both recipes, seven weight entries, the activity.
    Both startup repairs Correct, and their silence is the point. No OffMicronutrientRepair line — the rows are already stamped, so it is the no-op the design promises. No TrackedDayTotalRepair line either: ensureTrackedDayTotalsFinite returns at if (broken.isEmpty) return 0; before logging, and nothing on this device was ever NaN. Zero E/flutter, zero FATAL, zero Infinity or NaN toInt across the session.
    Migration still intact Confirmed durable across a second upgrade.
    Export scan Every field of user_intake.json, user_tracked_day.json, user_recipes.json and user_activity.json walked recursively: zero non-finite values, and zero literal NaN/Infinity in the JSON text.
    Scanner (the last inconclusive item) Pass — maintainer confirmed the camera image appears. The black preview in the previous run was the dark room, not mobile_scanner 7.4.1.

    The one thing not verified on device, and why that is acceptable

    The zero-base-quantity path itself was not exercised. custommealbox.hive is 0 bytes and every intake in the export is source: off — no custom meal was created, so the 100 / 0 → NaN → broken-totals sequence never ran. The screens rendering proves the build is healthy; it does not prove #1259 fixes #1254.

    Accepted on unit coverage, which reproduces the reported case by name rather than by inference:

    group('factorTo100gFromBase with a zero base (#1254)')
      '"0" falls back to a no-op factor of 1 instead of infinity'   → expect(…('0'), 1.0)
      'a negative base falls back to 1'
      'a nutriment typed as 0 at a zero base stays 0, not NaN'
          // The reported custom meal: every field 0, base quantity included.
    

    plus eight tests on tracked_day_total_repair (rebuilds a NaN day from its intakes, honours the day-start boundary, leaves finite days alone, rebuilds a broken day with no intakes to zero) and entity-level non-finite handling. All green on the merge run.

    The honest statement for the release: #1259 is verified by targeted unit tests that reproduce the reported scenario, and the rebuilt candidate is verified clean on device; the two were not joined up by logging a zero-base custom meal on the phone. The blocker for that is known and recorded — the custom-food form exposes no field identifiers and its keyboard reshuffles positions between taps, which is why S4 blocked in the first run too. The same form is both the bug's home and the reason it is hard to test, and that is worth fixing before the next release rather than during this one.

    Candidate for the develop → main PR: 680eafaa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions