mattermost-mobile-upstream/app/queries
yasser khan 69491de3ed
fix: map the record value in observeTutorialWatched and push-ack observables (#10101)
`main` CI has been red since f3af9dbe9 on:

    SendButton > should return true if the scheduled post tutorial is watched
    Expected: false / Received: true   (index.test.tsx:69)

Root cause is a pre-existing bug in app/queries/app/global.ts. Both observables
mapped `Boolean(v)` where `v` is the GlobalModel emitted by `result[0].observe()`,
not its value. `Boolean(model)` is always true, so ANY existing row read as set
regardless of what it contained.

The test's afterEach clears via `storeGlobal(Tutorial.SCHEDULED_POST, null)`, which
writes a row with a null value rather than deleting it. The second test therefore
mounted already "watched" and failed its first assertion.

observePushDisabledInServerAcknowledged had the identical bug, and there it is a
live defect rather than a test artifact: removePushDisabledInServerAcknowledged
also clears by writing null, so a removed acknowledgement kept reading as
acknowledged and the push-disabled warning stayed suppressed.

Both now map the record's value, matching getPushDisabledInServerAcknowledged
directly above them, which already did `Boolean(records?.[0]?.value)`.

No production behaviour change for the tutorial keys: every writer stores only
'true' (app/actions/app/global.ts:40-60, :115) and nothing writes 'false', so a
row exists only when the value is 'true' and old/new agree.

Verified:
- send_button suite 2/2 pass (fails 1/2 on this branch without the change)
- all 9 observeTutorialWatched consumers + push_proxy: 21 suites, 151 tests pass
- tsc --noEmit and eslint clean
2026-08-28 15:34:05 +05:30
..
app fix: map the record value in observeTutorialWatched and push-ack observables (#10101) 2026-08-28 15:34:05 +05:30
servers fix: Product fixes to run e2e tests (#10081) 2026-08-26 16:12:37 +05:30