Skip to content

fix(#321): mark push-notification deep-linked posts read once synced - #324

Merged
cassio-rossi merged 1 commit into
release/v5from
fix/321-push-notification-read-not-marked
Jul 30, 2026
Merged

fix(#321): mark push-notification deep-linked posts read once synced#324
cassio-rossi merged 1 commit into
release/v5from
fix/321-push-notification-read-not-marked

Conversation

@cassio-rossi

Copy link
Copy Markdown
Collaborator

Summary

  • Push-notification deep links could open a brand-new article before it finished syncing into local FeedDB (the sync is triggered separately via shouldReloadContent), so DeepLinkNewsDetailView's one-shot .onAppear computed post == nil and silently skipped markAsRead().
  • Widget and Home Screen Shortcut deep links only ever point to already-synced posts, so they were unaffected — this made the bug look push-notification-specific.
  • Added .onChange(of: post) alongside the existing .onAppear so the read state is applied reactively once the live @Query resolves a matching FeedDB row.

Test plan

  • xcodebuild build — succeeded (iPhone 17 Pro simulator unavailable on this machine; built against iPhone 17 Pro Max instead)
  • xcodebuild test -testPlan MacMagazine — 511 tests across all 10 suites passed
  • swiftlint lint --strict — 0 violations across 243 files
  • No new automated test added for this specific fix: the bug lives in SwiftUI view state-timing (.onAppear/.onChange), there's no test target for the main MacMagazine app target, and project testing rules explicitly exclude testing view bodies — verified by build/lint/manual read only.

🤖 Generated with Claude Code

DeepLinkNewsDetailView resolved `post` once in .onAppear, so a push
notification opening a brand-new article (not yet synced into FeedDB
by the concurrent shouldReloadContent refresh) computed post == nil
and silently skipped markAsRead(). Widget and Shortcut links only ever
point to already-synced posts, so they were unaffected. Add
.onChange(of: post) so the read state is applied reactively once the
live @query resolves a matching FeedDB row.

Co-Authored-By: Claude <noreply@anthropic.com>
@cassio-rossi
cassio-rossi merged commit 9e72822 into release/v5 Jul 30, 2026
2 checks passed
@cassio-rossi
cassio-rossi deleted the fix/321-push-notification-read-not-marked branch July 30, 2026 00:03
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