Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: null pointer in call participants list [WPB-15783] #3855

Merged
merged 1 commit into from
Feb 4, 2025

Conversation

Garzas
Copy link
Contributor

@Garzas Garzas commented Feb 4, 2025

BugWPB-15783 [Android] Unexpected drop from call in MLS group


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

  • Fixed IndexOutOfBoundsException in VerticalCallingPager that occurred when removing the first participant (self user) in Picture-in-Picture (PiP) mode.
  • Prevented crashes when accessing participantsChunkedList due to inconsistent page count calculations.

Causes (Optional)

  • When PiP mode was enabled and there was more than one participant, the first participant was removed using subList(1, participants.size). However, pagerState.pageCount was calculated before this modification, leading to a mismatch in page count.
  • The rememberPagerState relied on participants.size, which didn't reflect the adjusted participant list after subList(), sometimes leading to pageIndex being out of range.
  • The LaunchedEffect block was trying to access participantsChunkedList[pagerState.currentPage] without verifying if pageIndex was within bounds.

Solutions

  • Moved newParticipants calculation outside of VerticalPager, ensuring it is computed before pagerState.pageCount is determined.
  • Updated pagerState to correctly reflect the actual number of pages by using participantsChunkedList.size instead of the original participants.size.
  • Added safe access with getOrNull(pageIndex) when retrieving elements from participantsChunkedList to prevent IndexOutOfBoundsException.
  • Ensured LaunchedEffect only attempts to request video streams when the current page index is valid.

@Garzas Garzas self-assigned this Feb 4, 2025
@echoes-hq echoes-hq bot added the echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. label Feb 4, 2025
Copy link

sonarqubecloud bot commented Feb 4, 2025

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Built wire-android-staging-compat-pr-3855.apk is available for download

@MohamadJaara MohamadJaara added this pull request to the merge queue Feb 4, 2025
Merged via the queue into release/candidate with commit 6d47984 Feb 4, 2025
15 of 16 checks passed
@MohamadJaara MohamadJaara deleted the fix/call-participants-null-pointer branch February 4, 2025 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: product-roadmap/bug Work contributing to resolve a bug not critical enough to have raised an incident. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants