Skip to content

refactor: collect conversations and messages only when resumed [WPB-25040]#4757

Merged
saleniuk merged 1 commit into
developfrom
refactor/collect-pagingdata-only-when-resumed
Apr 24, 2026
Merged

refactor: collect conversations and messages only when resumed [WPB-25040]#4757
saleniuk merged 1 commit into
developfrom
refactor/collect-pagingdata-only-when-resumed

Conversation

@saleniuk
Copy link
Copy Markdown
Contributor

@saleniuk saleniuk commented Apr 24, 2026

https://wearezeta.atlassian.net/browse/WPB-25040


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

When the app is in the background, the flow of PagingData is still being collected.

Solutions

Use flowWithLifecycle to collect only when the state is RESUMED, so when the app is in the foreground. It will start collecting back when the app comes from the background. Created a new extension function collectAsLazyPagingItemsWithLifecycle that can easily replace collectAsLazyPagingItems where needed. For previews the lifecycle part is disabled so that it doesn't break them.

Testing

How to Test

Open the app, put it into background, receive some messages, check if the flow is emitting values when the app is in the background.


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@MohamadJaara MohamadJaara left a comment

Choose a reason for hiding this comment

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

LGTM

@saleniuk saleniuk changed the title refactor: collect conversations and messages only when resumed refactor: collect conversations and messages only when resumed [WPB-25040] Apr 24, 2026
@saleniuk saleniuk added this pull request to the merge queue Apr 24, 2026
Merged via the queue into develop with commit 6d4afc8 Apr 24, 2026
21 of 23 checks passed
@saleniuk saleniuk deleted the refactor/collect-pagingdata-only-when-resumed branch April 24, 2026 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants