On the screen with the item list, the “new” tag must update after a local event arrives and after the cell is reconfigured. Right now, in some scenarios, the counter and visual state freeze until the next full redraw.
Requirements
- The screen is implemented in SwiftUI, but the data source and event subscription are in a separate
ObservableObject.
- Target runtime: iOS 18, Swift 6 language mode,
@MainActor-isolated view model.
- Events come from a deterministic test publisher, with no network requests and no background timers.
FeedRow must display:
- the item title;
- the text
New when isFresh == true;
- the count of unread items in a badge.
- When a row is reconfigured with the same
id, the state must match the new FeedItem.
- Errors and fault tolerance must be handled without crashing the app.
Reproduction
- Open the screen and pass in an array of two items where
isFresh == false.
- Send an update event to the publisher for the first item, where
isFresh == true and unreadCount == 3.
- Update the list with the same
id, but with a new title and isFresh == false.
- Observe that one of the rows keeps showing the previous badge or the previous freshness flag.
Expected behavior
- After each event, the interface updates on the main actor.
- When a row is reconfigured, the display fully matches the passed data.
- Stored subscriptions and observers do not retain stale state between row configurations.
- There are no update stalls or missed notifications during a rapid sequence of two events.