freshyo/MULTI_REGION_PROBLEMS.md
2026-10-07 00:27:11 +05:30

5.9 KiB
Raw Blame History

Problems found — multi-region testing (2026-10-06, local dev)

Source: Maestro MCP runs (iOS sim 5A64695E, Chromium) + tRPC API checks against local backend 127.0.0.1:8787. Test data: region 8 (MCPTest-222329), products 157/158, tags 1–3, slot 1, user address 872. Full per-test report in session notes; this file lists defects only.

Open app defects

P1 — Add Address silently drops the save (data-loss UX)

  • Repro: Me → Addresses → + → fill Name/Phone/Line-1, Attach Current Location (spoofed Jadcherla 16.76,78.14 → "Location Attached"), pick Jadcherla in the region dropdown → Add Address. Sheet closes, no error — but getUserAddresses still returns 1 address.
  • Same payload via user.address.createAddress API succeeds (id 872, region 7), so the app form never POSTs or swallows the error.
  • Fix: surface backend errors; verify the payload mapping (city field still read "Mahabubnagar"/pin "509001" while region=Jadcherla — check whether a city/pin-vs-region validation rejects it server- or client-side without a toast).

P2 — Changing default address to another region does not switch region

  • Repro: set the Jadcherla address as default ("Success — Default address updated") → Home still shows Mahabubnagar + MBNR data. No region switch, no reconciliation notice.
  • Product decision needed: should default-address drive the active region, or is region strictly location/device-driven? Either way the silent no-op is wrong — at minimum notify ("address saved; region unchanged").

P3 — Availability cache goes stale; OOS persists after DB says in-stock

  • DB product_market_stats: sku 160 in-stock @175 in region 6; slot 1 created (region 6, skus 160+161). App still shows Out of Stock @₹100 after relaunch + pull-to-refresh.
  • Root cause: the app re-reads availability only when its version bumps, and nothing in the tested writes bumped availability_version_num. Slot/product writes go through fire-and-forget scheduleStoreInitialization (DO), which never visibly ran locally.
  • Impact: blocks all cart/checkout E2E (tests 16/17/19) — every item unreadable as purchasable.

P4 — Stale price display (same root cause as P3)

  • Card shows ₹100/₹120 after backend price update to 175/200 (admin.product. updateProduct verified via API). Products file is version-sticky the same way.

P5 — Region name spelling: "Jadcherla" (app/region picker) vs "Jadcherla" (DB)

  • getRegions returns Jadcherla; the app header, out-of-service cards, and the address region picker render "Jadcherla". Maestro tapOn: "Jadcherla" fails — only coordinate taps work. Confirm the intended spelling and fix one side.

P6 — In-app location change alone does not re-resolve region

  • Spoof MBNR→Jadcherla while the app is foregrounded: header stays Mahabubnagar. Region re-resolves only on relaunch. If live re-resolution is intended, the location listener is not firing/refreshing; if relaunch-only is intended, document it (tests 14/15 depend on it).

P7 — Region selector is sticky; spec expects scroll-out (test 20)

  • After 2× swipe-up on Home, the region header + search remain visible. Either the spec ("selector is scrolled out") is outdated or the sticky header is a regression. Product call.

P8 — No notif-creds endpoint fires on region change/detect (tests 23/24)

  • No dedicated endpoint found in the user router; notif_creds table has a regionId FK but nothing observed writing it on region switch or auto-detect. Verify whether the mobile client is supposed to call something here or the requirement is obsolete.

P9 — Legacy default address points at dead region

  • User 388's default address (id 285) has regionId: 1, but regions are now 6/7/8. Anything joining address→region for this user silently misses. Data hygiene: re-point or null it.

Test-harness notes (Maestro, not app bugs)

  • Password secureTextEntry field: inputText never focuses it (no keyboard, text goes nowhere). Working sequence: tap user-login-password by id → eraseText: 50 → setClipboard + pasteText. Note: inputText with @ keystroke-types an extra y (multilingual SIM keyboard EN HI); paste avoids it.
  • Never tap a button with the keyboard up: the tap lands on the keyboard (observed phantom y appended to the password when tapping Login).
  • inspect_screen on the user app throws RangeError: max depth 32 — used screenshots + targeted tapOn instead.
  • Out-of-service screen doubles as the region picker (lists all regions incl. newly created ones) — useful fallback for region selection tests.

Fixed during this session (for reference, not open)

  • Store submit tap eaten by open keyboard → keyboard dismissal via static-text tap + assertVisible before every button tap.
  • BottomDialog sat under the iOS keyboard → manual Keyboard-driven inset; the maxHeight: 85% cap choked the inset and was removed (verified live: sheet bottom lands exactly at keyboard top).
  • BottomDropdown option taps swallowed with keyboard open → added keyboardShouldPersistTaps="handled" to the inner option-list ScrollView (was only on the outer dialog scroll).
  • Native iOS date picker: same-day picks never fire onChange (modal never closes); freeze-picked-second crossed minute boundaries (freeze > delivery). Now freeze-first + same-day force-change branch in set-slot-time-ios.yaml.
  • Flow scoping: output.* from evalScript does not reach nested runFlow.when.commands in subflows — all matchers compute slugs inline.
  • scrollUntilVisible + centerElement: true re-nudges endlessly on visible elements; screen-level scrolls move the page behind bottom sheets (superseded by search-then-select in product pickers).
  • BottomDropdown option ids now embed a label slug (<testID>-option-<value>-<slug>); flow matchers anchor with .*.
  • Exact slot times need the slots/add.tsx dts/fts deep-link prefill hook (native picker is calendar-only).