Skip to content

fix ios notification crashes#1976

Merged
Tlaster merged 1 commit intomasterfrom
bugfix/ios-crashes
Apr 6, 2026
Merged

fix ios notification crashes#1976
Tlaster merged 1 commit intomasterfrom
bugfix/ios-crashes

Conversation

@Tlaster
Copy link
Copy Markdown
Contributor

@Tlaster Tlaster commented Apr 6, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent iOS notification screen crashes by stabilizing SwiftUI state synchronization (selected account + filter), ensuring the timeline view is recreated with a deterministic key when selection changes, and reducing redundant UI updates from presenter/network change streams.

Changes:

  • Reworked NotificationScreen to sync selected account/filter via stable keys and to rebuild TimelinePagingContent using a composite timelineKey.
  • Updated KotlinPresenter to skip publishing when the presenter emits the same state instance.
  • Simplified NetworkMonitor updates to only publish kind changes and fixed mapping to use NWPath’s current flags.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
iosApp/flare/UI/Screen/NotificationScreen.swift Adds stable-key based account/filter sync and timeline keying to avoid inconsistent SwiftUI state during selection changes.
iosApp/flare/UI/Component/KotlinPresenter.swift Avoids redundant @Published updates when the emitted Kotlin state object is identical.
iosApp/flare/UI/Component/AvatarView.swift Changes avatar clipping to use a type-erased shape in a ternary expression.
iosApp/flare/Common/NetworkMonitor.swift Publishes network kind only on changes; computes constrained/expensive directly from the current NWPath.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 8 to 10
NetworkImage(data: data)
.if(avatarShape == .circle, if: { view in
view.clipShape(.circle)
}, else: { view in
view.clipShape(.rect(cornerRadius: 8))
})
.clipShape(avatarShape == .circle ? AnyShape(.circle) : AnyShape(.rect(cornerRadius: 8)))
}
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AnyShape is referenced here but there is no AnyShape type defined anywhere in the repository, and SwiftUI doesn't provide an AnyShape type on the iOS 17 deployment target. This will fail to compile unless you add a type-erased AnyShape implementation (or revert to the existing .if(..., else:) clipShape approach).

Copilot uses AI. Check for mistakes.
@Tlaster Tlaster merged commit 3c6919e into master Apr 6, 2026
13 of 16 checks passed
@Tlaster Tlaster deleted the bugfix/ios-crashes branch April 6, 2026 13:16
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.

2 participants