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

timeline : makes sure to emit empty list if initial reset has no item. #3538

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

ganfra
Copy link
Member

@ganfra ganfra commented Sep 25, 2024

Content

timeline : makes sure to emit empty list if initial reset has no item.

Motivation and context

Fix empty pinned messages list stuck on loading.

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 23
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • Pull request includes a sign off
  • You've made a self review of your PR

@ganfra ganfra added the PR-Bugfix For bug fix label Sep 25, 2024
@ganfra ganfra marked this pull request as ready for review September 25, 2024 13:40
@ganfra ganfra requested a review from a team as a code owner September 25, 2024 13:40
@ganfra ganfra requested review from jmartinesp and removed request for a team September 25, 2024 13:40
Copy link
Contributor

github-actions bot commented Sep 25, 2024

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/UHWDXM

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! Feel free to ignore the comment below, I just wanted to make sure we don't remove this code in the future while thinking it's not needed.

items.chunked(INITIAL_MAX_SIZE).reversed().forEach {
ensureActive()
timelineDiffProcessor.postItems(it)
if (items.isEmpty()) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add a comment for why this is needed? Not a must, though.

@ganfra ganfra force-pushed the feature/fga/timeline_emit_empty_list branch from 2a0ea1e to db569cb Compare September 25, 2024 13:50
@ganfra ganfra added the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 25, 2024
@github-actions github-actions bot removed the Run-Maestro Starts a Maestro Cloud session to run integration tests label Sep 25, 2024
Copy link

sonarcloud bot commented Sep 25, 2024

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.62%. Comparing base (14dc0da) to head (db569cb).
Report is 2 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3538   +/-   ##
========================================
  Coverage    82.62%   82.62%           
========================================
  Files         1732     1732           
  Lines        40939    40939           
  Branches      4980     4980           
========================================
  Hits         33827    33827           
  Misses        5343     5343           
  Partials      1769     1769           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ganfra ganfra merged commit fdd0a0d into develop Sep 25, 2024
30 checks passed
@ganfra ganfra deleted the feature/fga/timeline_emit_empty_list branch September 25, 2024 15:33
} else {
// Split the initial items in multiple list as there is no pagination in the cached data, so we can post timelineItems asap.
items.chunked(INITIAL_MAX_SIZE).reversed().forEach {
ensureActive()
Copy link
Member

Choose a reason for hiding this comment

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

Interesting to note that

emptyList<Unit>().chunked(5) return an empty list and not listOf(emptyList())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants