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

Show/Hide Unified Inbox does not update immediately #8767

Open
2 tasks done
shamim-emon opened this issue Jan 22, 2025 · 1 comment · May be fixed by #8847
Open
2 tasks done

Show/Hide Unified Inbox does not update immediately #8767

shamim-emon opened this issue Jan 22, 2025 · 1 comment · May be fixed by #8847
Labels
type: bug Something is causing incorrect behavior or errors

Comments

@shamim-emon
Copy link
Contributor

shamim-emon commented Jan 22, 2025

Checklist

  • I have used the search function to see if someone else has already submitted the same bug report.
  • I will describe the problem with as much detail as possible.

App

Thunderbird for Android

App version

10.0-SNAPSHOT

Where did you get the app from?

None

Android version

Android 12

Device model

No response

Steps to reproduce

Open The Application.
Click on Side Menu
Click on Setting Gear at the bottom of menu
Click on General Settings-> Display
Scroll to Account List Section
Toggle Show Unified Inbox
Navigate back to Home screen
In side menu change is not reflected.
If you close the app and open again, change is reflected.

Expected behavior

Toggle Show Unified Inbox should reflect immediately without re-starting the app.

Actual behavior

Toggle Show Unified Inbox reflects only after re-starting the app.

Logs

No response

@shamim-emon shamim-emon added type: bug Something is causing incorrect behavior or errors unconfirmed Newly reported issues awaiting triage or confirmation labels Jan 22, 2025
@kewisch kewisch removed the unconfirmed Newly reported issues awaiting triage or confirmation label Jan 22, 2025
@mhf1998
Copy link
Contributor

mhf1998 commented Feb 19, 2025

Hi everyone,

I've been investigating this issue (#8767) and have identified the root cause of the problem. It turns out that the real issue is not just that the Unified Inbox toggle does not update immediately—rather, it's that the activity recreation logic causes screens to stack on top of each other instead of replacing each other properly.

Findings & Root Cause

I carefully analyzed the behavior and found that the issue occurs in two scenarios:

Scenario 1: Enabling Unified Inbox (which was initially disabled)

  1. The Unified Inbox is disabled (unchecked in settings).
  2. The app correctly displays the regular inbox in both the account list and side menu.
  3. The user enables "Show Unified Inbox" in settings and returns to the Message List.
  4. The UI still shows the regular inbox instead of the unified inbox.
  5. Pressing Back does something unexpected: instead of closing the app, the current Message List (showing the regular inbox) disappears, and another Message List appears underneath it, now displaying the unified inbox.
  6. This means that instead of replacing the previous activity, the new one was added underneath it, which is incorrect.

Scenario 2: Disabling Unified Inbox (which was initially enabled)

  1. The Unified Inbox is enabled (checked in settings).
  2. The app correctly displays the unified inbox in both the account list and side menu.
  3. The user disables "Show Unified Inbox" in settings and returns to the Message List.
  4. The UI still shows the unified inbox instead of switching to the regular inbox.
  5. Pressing Back again does something unexpected: instead of closing the app, the current Message List (showing the unified inbox) disappears, and another Message List appears underneath it, now displaying the regular inbox.
  6. Just like in Scenario 1, the new activity was added underneath instead of replacing the existing one.

Why is this happening?

The issue is caused by how the activity is being recreated:

  • The current implementation calls ActivityCompat.recreate(this).
  • This does not fully replace the current activity—instead, it creates a new instance on top of the previous one.
  • This results in stacked Message List screens, leading to the delayed UI update that was originally reported in this issue.

Next Steps

I’ve identified a way to fix this so that the activity is properly replaced instead of stacking. I’ll be working on implementing this fix and will submit a PR as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something is causing incorrect behavior or errors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants