Skip to content

fix(android): never count copied Journal answers without confirmation - #119

Draft
kvnloo wants to merge 1 commit into
mainfrom
fav/fix-android-never-count-copied-journ-58
Draft

kvnloo wants to merge 1 commit into
mainfrom
fav/fix-android-never-count-copied-journ-58

Conversation

@kvnloo

@kvnloo kvnloo commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Problem (upstream link)

Opening Android Insights on a day with no native Journal answers silently persists yesterday's Yes/No answers as today's observed evidence. Those unconfirmed rows can enter behavior correlations and personal experiment views. This remains on upstream main at 2a1de760. Original source report: fork PR #58 and Journal integrity ledger #70. PR #58 did not identify a dedicated upstream issue; this PR does not attribute the defect to an unrelated user report.

Root cause (file:line at SHA)

At 2a1de7609843b095505274ad6fc811757210be80, android/app/src/main/java/com/noop/ui/InsightsScreen.kt:250-271 has a screen-load LaunchedEffect that calls vm.repo.upsertJournal(yesterdayAnswers...) when today's native answers are empty. A read of the page becomes a persistent Yes/No write, with no confirmation. It also ignores imported evidence and numeric/hidden question eligibility.

Change

  • Remove the implicit write. Offer a localized Copy previous answers action only on today's otherwise unanswered Journal; no row is copied until the user taps.
  • Re-read current native and imported records on confirmation; preserve newly written answers, both explicit Yes and explicit No, and prevent midnight-stale suggestions.
  • Copy only currently visible boolean prompts. Exclude numeric doses and hidden/deleted items; no schema, BLE, scoring formula, or new telemetry.
  • Carry forward the original fix(android): never count copied Journal answers without confirmation #58 helper, Android UI change, nine JUnit tests and behavior spec. Complete localization in all nine shipped Android locale directories (English, German, Spanish, French, Italian, Polish, Portuguese (Portugal), Russian, Chinese).
  • Apple parity: current Strand/Screens/InsightsView.swift reads native answers into state without inserting yesterday's rows on page load, so this is an Android-only correction that restores the shared behavior.

Supersedes #58. The fork's separate minimal #53 is an alternative no-auto-copy fix; do not merge/promote both blindly.

Tests

Not run. GitHub Actions is disabled on kvnloo/noop; no CI run or build result is claimed. Nine existing JUnit cases were re-read at this head. Numeric expectations checked manually:

  • Yesterday {read: true, caffeine: false}, blank today ⇒ suggestion retains both values, with zero writes during load; tomorrow or past-day offsets ⇒ zero suggestions.
  • A current native or imported answer ⇒ zero blanket suggestions.
  • Delayed tap with {read: true, late caffeine: false} pending, current {read: false} ⇒ copy only {late caffeine: false}; imported {read: true} likewise blocks an overwrite.
  • Yesterday's numeric Caffeine (mg)=120.0 ⇒ not copied; visible boolean Read a page?=true and Avoided screen?=false retain their values; hidden prompts excluded.

Hermes exact-head verification:

cd android
./gradlew --no-build-cache --rerun-tasks testFullDebugUnitTest
./gradlew --no-build-cache --rerun-tasks compileFullDebugKotlin
cd ..
python3 Tools/i18n_audit.py --ci

Expected upstream check names for these Android+docs paths: build-and-test (Android CI), check (i18n Coverage), doc-comments (Source Hygiene), linux-capture (Tools Python CI). Swift Packages/App build and Windows capture are not path-triggered.

Hardware needed

No physical strap or BLE connection is needed for the pure confirmation/collision tests. Before promotion, Android device QA should verify first-open no-write, tap confirmation, imported-vs-native collision, midnight rollover, screen resume, TalkBack and large text. A real strap is only necessary for a separately scoped live-capture workflow; none was tested here.

Upstream readiness

Draft / HOLD until Hermes runs tests against this exact head, independent review confirms data semantics and locale rendering, #53 is deduplicated, and Kevin explicitly approves upstream promotion. Search of upstream Journal PRs found no exact confirmation-copy successor at time of branch creation; repeat before any upstream post. No upstream writes were made.

Implemented by ChatGPT (mobile app, GitHub connector) for Kevin's NOOP factory.

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