The attachment summary screen must display the last modification date and a short calculation status. Currently, after some updates, the interface continues to show stale data even though the input model has already changed.
Requirements
- The screen is implemented in SwiftUI and runs on the iOS 18 SDK.
- The code compiles in Swift 6 with strict
MainActor checking for the UI layer.
- Screen properties are passed through
AttachmentSummaryInput.
- The summary is built only from the provided data, without network calls and without accessing the system clock.
- Tests use a deterministic
DateFormatter and a fixed calendar/locale.
- It is expected that when the input model changes, the summary string and the date are recalculated.
- It is expected that cancellation of the calculation does not turn into a regular error and does not replace the current text with an empty state.
Reproduction
- Open
AttachmentSummaryView with a model where title = "Photo", updatedAt = 2026-01-10T09:15:00Z, status = "done".
- Update the same screen with a new model with the same
id, but a different updatedAt and a different status.
- Capture the second render without recreating the parent screen.
- Cancel the background calculation task at the moment the model changes.
Expected behavior
- After the input model changes, the summary text should update to the new date and new status.
- Data from the previous model should not survive a re-render.
- If the calculation is cancelled, the screen should keep the last correct text instead of switching to an error state.
- Showing the same screen again with a different model should not depend on the old value stored in local state.