Skip to content

Conversation

@caldrian
Copy link
Contributor

@caldrian caldrian commented Oct 27, 2025

BugWPB-21128 [iOS] Selecting a poll option in MLS conversation, result shows incorrect

Issue

There is a bug in LeadingTrailingDebouncer which causes conversation message cells to display wrong content when the content is updated.

Testing

The new poll app's result cell should now always show the correct result.


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.

Copy link
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 fixes a bug in LeadingTrailingDebouncer where conversation message cells displayed incorrect content when updated. The fix involves removing the generic type parameter and improving the state management logic.

Key Changes:

  • Simplified LeadingTrailingDebouncer by removing generic type parameter and using UUID directly
  • Fixed state management logic to properly update states dictionary and handle trailing calls
  • Added comprehensive test coverage for debouncer behavior

Reviewed Changes

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

File Description
ConversationTableViewDataSource.swift Removed generic type parameter from debouncer instantiation
LeadingTrailingDebouncerTests.swift Added new test file with three test cases covering single call, first-and-last, and skip scenarios
LeadingTrailingDebouncer.swift Removed generic type constraint, fixed state update bug, added thread safety check, and simplified cooldown logic

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 27, 2025

Test Results

1 926 tests   1 899 ✅  2m 39s ⏱️
  311 suites     27 💤
    2 files        0 ❌

Results for commit d38fb07.

♻️ This comment has been updated with latest results.

@caldrian caldrian requested review from a team, jullianm and samwyndham and removed request for a team October 28, 2025 09:46
Copy link
Contributor

@jullianm jullianm left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
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.

Oh I wish this wasn't code we needed to maintain. My brain is tired.

@caldrian caldrian force-pushed the fix/updating-message-cells-WPB-21128 branch from 478d863 to 93d89a2 Compare October 29, 2025 08:35
@caldrian caldrian marked this pull request as draft November 3, 2025 11:08
auto-merge was automatically disabled November 3, 2025 11:08

Pull request was converted to draft

…eapp/wire-ios into fix/updating-message-cells-WPB-21128
…eapp/wire-ios into fix/updating-message-cells-WPB-21128

# Conflicts:
#	wire-ios-request-strategy/Sources/Payloads/Payload.swift
@caldrian caldrian changed the base branch from release/cycle-4.9 to develop November 3, 2025 11:11
@caldrian caldrian marked this pull request as ready for review November 3, 2025 11:12
@caldrian caldrian enabled auto-merge November 3, 2025 11:51
@caldrian caldrian added this pull request to the merge queue Nov 3, 2025
Merged via the queue into develop with commit 7894716 Nov 3, 2025
10 checks passed
@caldrian caldrian deleted the fix/updating-message-cells-WPB-21128 branch November 3, 2025 14:12
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.

7 participants