Files
platform/ios
Yusuf Suleman c0078adeb7
All checks were successful
Security Checks / dockerfile-lint (push) Successful in 4s
Security Checks / dependency-audit (push) Successful in 14s
Security Checks / secret-scanning (push) Successful in 4s
fix: synchronous optimistic read-state on article open
The local entries mutation now runs synchronously at the top of
.task, before any Task {} or await:

  1. vm.entries[idx].status = "read"  ← synchronous, immediate
  2. currentEntry syncs from mutated array  ← immediate
  3. Task { api.markEntries + getCounters }  ← background
  4. await getEntry  ← content fetch, merge preserves local status

Previously markAsRead was wrapped in Task {} (fire-and-forget),
which SCHEDULED the mutation but didn't execute it until the main
actor yielded. Line 2 read stale state because the mutation hadn't
run yet.

Now the @Observable array mutation happens before any async work,
so the ForEach row re-renders on the same run loop — the list
shows "read" even during the push animation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 22:13:56 -05:00
..