Skip to content

fix(home): stop telling customers their real repairs are examples - #78

Merged
PapiCuche merged 1 commit into
mainfrom
fix/mock-notice-over-real-data
Oct 21, 2026
Merged

PapiCuche merged 1 commit into
mainfrom
fix/mock-notice-over-real-data

Conversation

@PapiCuche

Copy link
Copy Markdown
Owner

Found in the native development build against a live backend: the customer home screen rendered the «datos de ejemplo» notice unconditionally. With mock data off and the server answering — real repairs, real orders, the server's own figures on screen — the app still said none of it was real.

The order detail screen had the same defect, with wording about an endpoint that «requiere el contrato de autenticación web» — a sentence that stopped being true when the native auth contract shipped.

Why nothing caught it

Every other screen with this notice already gates it on useMockData: shop, product, order list, login. These two did not — and the test suite runs with mock data on, where an unconditional notice and a correct one look identical.

So the regression test lives in its own file with the flag mocked before the screen is imported: the condition is module-level, and re-requiring the screen inside the existing suite hands React a second copy of itself (that attempt failed with Cannot read properties of null (reading 'use'), which is what sent it to its own file).

Who this costs

The person whose phone is being repaired, reading a repair screen that tells them the status they just read is made up.

Checks

  • 110 suites / 2046 tests (1 new file, 1 case)
  • tsc --noEmit clean, eslint 0 errors
  • expo export ios + android pass
  • expo-doctor reports fresh upstream patch drift (expo, expo-network, expo-router, expo-sharing) — unrelated to this change, handled in a separate maintenance PR

🤖 Generated with Claude Code

Found in the native development build against a live backend: the customer
home screen rendered the «datos de ejemplo» notice UNCONDITIONALLY. With mock
data off and the server answering — real repairs, real orders, the server's own
figures on screen — the app still said none of it was real.

The order detail screen had the same defect, with its own wording about an
endpoint that «requiere el contrato de autenticación web» — a sentence that
stopped being true when the native auth contract shipped.

Every other screen that shows this notice already gates it on `useMockData`:
the shop, the product, the order list and the login all check. These two did
not, and nothing caught it because the test suite runs with mock data ON,
where an unconditional notice and a correct one look identical.

So the regression test is its own file, with the flag mocked before the screen
is imported — the condition is module-level, and re-requiring the screen inside
the existing suite hands React a second copy of itself.

Who this costs: the person whose phone is being repaired, reading a repair
screen that tells them the status they just read is made up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@PapiCuche
PapiCuche merged commit 135fd7d into main Oct 21, 2026
2 of 3 checks passed
@PapiCuche
PapiCuche deleted the fix/mock-notice-over-real-data branch October 21, 2026 15:49
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