Skip to content

fix: Removed duplicated alert system. - WPB-23037#4492

Open
JaCaLlaSchwarz wants to merge 21 commits intodevelopfrom
fix/remove_duplicated_warning_message_WPB23037_v2
Open

fix: Removed duplicated alert system. - WPB-23037#4492
JaCaLlaSchwarz wants to merge 21 commits intodevelopfrom
fix/remove_duplicated_warning_message_WPB23037_v2

Conversation

@JaCaLlaSchwarz
Copy link
Copy Markdown
Collaborator

@JaCaLlaSchwarz JaCaLlaSchwarz commented Mar 25, 2026

BugWPB-23037 [iOS] Duplicate initial system messages

Issue

Duplicated Alert warning message
simulator_screenshot_3A0756FF-82F6-4ABD-8B5A-4A02C1930624

Testing

Before After
simulator_screenshot_3A0756FF-82F6-4ABD-8B5A-4A02C1930624  simulator_screenshot_93B2FA66-E291-4F83-9E1C-2ABC7EE03F63

Checklist

  • Title contains a reference JIRA issue number like [WPB-XXX].
  • Description is filled and free of optional paragraphs.
  • Adds/updates automated tests.

UI accessibility checklist

If your PR includes UI changes, please utilize this checklist:

  • Make sure you use the API for UI elements that support large fonts.
  • All colors are taken from WireDesign.ColorTheme or constructed using WireDesign.BaseColorPalette.
  • New UI elements have Accessibility strings for VoiceOver.

@JaCaLlaSchwarz JaCaLlaSchwarz changed the title fix: Removed duplicated alert system. WPB - 23037 fix: Removed duplicated alert system. WPB-23037 Mar 25, 2026
@JaCaLlaSchwarz JaCaLlaSchwarz changed the title fix: Removed duplicated alert system. WPB-23037 fix: Removed duplicated alert system. - WPB-23037 Mar 25, 2026
Copy link
Copy Markdown
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

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

Left a couple comments, it's going towards the right direction but still need some changes before approval.

I would expect conversation snapshot test to change too somehow

connectionViewController = UserConnectionViewController(userSession: userSession, user: otherParticipant)
headerView = connectionViewController?.view
} else {
noUserConnectionViewController = NoUserConnectionViewController(userSession: userSession)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: I feel like the name of this view NoUserConnectionViewController is a bit misleading, as it's the header for groups or channels.

maybe DefaultConversationHeaderViewController, feel free to challenge this name ;)


let connectionOrOneOnOne = conversation.conversationType == .connection || conversation
.conversationType == .oneOnOne
let connectionOrOneOnOne = [.connection, .oneOnOne /* , .group */ ]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: revert, this change is not necessary

await context.perform { [self] in
if isInitialFetch {
// we just got a new conversation, we display new conversation header
localConversation.appendNewConversationSystemMessage(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue: not inserting the new conversationsystemMessage is not enough (+ could be avoided). For current conversations the double system message would still show.

I suggest to not return a cell on the conversationContentViewController for the newConversation system message

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Test Results

1 876 tests   1 825 ✅  2m 14s ⏱️
  300 suites     27 💤
    1 files       24 ❌

For more details on these failures, see this check.

Results for commit ad9b1be.

♻️ This comment has been updated with latest results.

Summary: workflow run #23837176590
Allure report (download zip): html-report-28952-fix_remove_duplicated_warning_message_WPB23037_v2

@JaCaLlaSchwarz JaCaLlaSchwarz requested a review from netbe March 25, 2026 15:30
@JaCaLlaSchwarz JaCaLlaSchwarz force-pushed the fix/remove_duplicated_warning_message_WPB23037_v2 branch from 90c22a2 to ae6308f Compare March 25, 2026 16:55
@datadog-wireapp
Copy link
Copy Markdown

datadog-wireapp bot commented Mar 25, 2026

⚠️ Tests

Fix all issues with Cursor

⚠️ Warnings

🧪 24 Tests failed

testChannelHistoryDepthForNewConversation() from Wire-iOS-Tests.ConversationSystemMessageChannelHistoryDepthSnapshotTests   View in Datadog   (Fix with Cursor)
ConversationSystemMessageChannelHistoryDepthSnapshotTests.swift:102: XCTAssertNil failed: "Snapshot "320.0" does not match reference.

@−
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/Wire-iOS Tests/ReferenceImages/ConversationSystemMessageChannelHistoryDepthSnapshotTests/testChannelHistoryDepthForNewConversation.320-0.png"
@+
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/SnapshotResults/ConversationSystemMessageChannelHistoryDepthSnapshotTests/testChannelHistoryDepthForNewConversation.320-0.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
...
testThatItRendersNewConversationCell_SelfIsCollaborator_AllowGuests() from Wire-iOS-Tests.StartedConversationCellTests   View in Datadog   (Fix with Cursor)
StartedConversationCellTests.swift:179: XCTAssertNil failed: "Snapshot "414.0" does not match reference.

@−
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/Wire-iOS Tests/ReferenceImages/StartedConversationCellTests/testThatItRendersNewConversationCell_SelfIsCollaborator_AllowGuests.414-0.png"
@+
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/SnapshotResults/StartedConversationCellTests/testThatItRendersNewConversationCell_SelfIsCollaborator_AllowGuests.414-0.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
...
testThatItRendersNewConversationCell_SelfIsGuest_AllowGuests() from Wire-iOS-Tests.StartedConversationCellTests   View in Datadog   (Fix with Cursor)
StartedConversationCellTests.swift:187: XCTAssertNil failed: "Snapshot "414.0" does not match reference.

@−
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/Wire-iOS Tests/ReferenceImages/StartedConversationCellTests/testThatItRendersNewConversationCell_SelfIsGuest_AllowGuests.414-0.png"
@+
"file:///Users/admin/actions-runner/_work/wire-ios/wire-ios/wire-ios/SnapshotResults/StartedConversationCellTests/testThatItRendersNewConversationCell_SelfIsGuest_AllowGuests.414-0.png"

To configure output for a custom diff tool, use 'withSnapshotTesting'. For example:

    withSnapshotTesting(diffTool: .ksdiff) {
...
View all

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ad9b1be | Docs | Was this helpful? Give us feedback!

@samwyndham
Copy link
Copy Markdown
Contributor

FYI I'll wait for the issues @netbe raised to be addressed before review.

Copy link
Copy Markdown
Collaborator

@netbe netbe left a comment

Choose a reason for hiding this comment

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

still some issues are there, please reply to my comments before re-asking for review

Comment on lines 179 to 194
cells.append(AnyConversationMessageCellDescription(startedConversationCell))

// Only display invite user cell for team members
if selfUser.isTeamMember,
conversation.selfCanAddUsers(selfUser: selfUser),
conversation.isOpenGroup {
cells.append(
AnyConversationMessageCellDescription(
GuestsAllowedCellDescription(isChannel: conversation.isChannel)
)
)
}

if conversation.isWireDriveEnabled {
let fileCollaborationCell = ConversationFileCollaborationSystemMessageCellDescription()
cells.append(AnyConversationMessageCellDescription(fileCollaborationCell))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thought: I wonder if all the cells here should move to header

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue: there seems to be a git lfs issue here, try:

git lfs migrate import --no-rewrite --yes wire-ios/Wire-iOS Tests/ReferenceImages/StartedConversationCellTests/testThatItRendersNewConversationCellStartedFromSelfWithOneParticipantAndWithoutName.414-0.png

let selfProfileUIBuilder: SelfProfileViewControllerBuilderProtocol
let conversationCreationRepository: any ConversationCreationRepositoryProtocol
var connectionViewController: UserConnectionViewController?
var defaultConversationHeaderViewController: DefaultConversationHeaderViewController?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
var defaultConversationHeaderViewController: DefaultConversationHeaderViewController?
var defaultConversationHeaderViewController: DefaultConversationHeaderViewController?

@JaCaLlaSchwarz JaCaLlaSchwarz requested a review from netbe March 30, 2026 09:41
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Copy Markdown
Contributor

@samwyndham samwyndham left a comment

Choose a reason for hiding this comment

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

Nice work. I've left a few questions questions/change requests regarding some UIKit points.


final class DefaultConversationHeaderView: UIView {

private static var correlationFormatter: AddressBookCorrelationFormatter = .init(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: Is this used anywhere?

Comment on lines +60 to +61
guestWarningContainer.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 0),
guestWarningContainer.trailingAnchor.constraint(equalTo: trailingAnchor, constant: 0),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: Sorry I'm forgetting UIKit :). Is the constant needed? I think if you remove the constant parameter it will be the same (like what you are doing with the top and bottom anchors)

)

private let guestWarningView = GuestAccountWarningView()
private let guestWarningContainer = UIView()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: What is the purpose of guestWarningContainer. Can't guestWarningView be added directly to self as DefaultConversationHeaderView is also a view.


fileprivate var defaultConversationHeaderView: DefaultConversationHeaderView!

let userSession: ZMUserSession
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: How is this property used?


final class DefaultConversationHeaderViewController: UIViewController {

fileprivate var defaultConversationHeaderView: DefaultConversationHeaderView!
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

suggestion: This property isn't accessed so it is not needed. Instead you can do:

override func loadView() {
    view = DefaultConversationHeaderView()
}

Comment on lines +45 to +46
defaultConversationHeaderViewController = DefaultConversationHeaderViewController(userSession: userSession)
headerView = defaultConversationHeaderViewController?.view
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: What is the need for the existence of DefaultConversationHeaderViewController? This view controller doesn't seem to do anything. My guess is we can delete DefaultConversationHeaderViewController and just use DefaultConversationHeaderView directly.

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.

3 participants