fix(#321): mark push-notification deep-linked posts read once synced - #324
Merged
cassio-rossi merged 1 commit intoJul 30, 2026
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FeedDB(the sync is triggered separately viashouldReloadContent), soDeepLinkNewsDetailView's one-shot.onAppearcomputedpost == niland silently skippedmarkAsRead()..onChange(of: post)alongside the existing.onAppearso the read state is applied reactively once the live@Queryresolves a matchingFeedDBrow.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 passedswiftlint lint --strict— 0 violations across 243 files.onAppear/.onChange), there's no test target for the mainMacMagazineapp target, and project testing rules explicitly exclude testing view bodies — verified by build/lint/manual read only.🤖 Generated with Claude Code