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: isar crash on resume from app detach #16599

Merged
merged 2 commits into from
Mar 5, 2025
Merged

Conversation

shenlong-tanwen
Copy link
Member

Fixes #16504

Description

  • Setting log level to anything finer than INFO, results in a large number of log files being emitted which are buffered and flushed to the DB. However, Isar seems to suffer from an issue where if a write transaction is not properly closed on android, it hangs there and crashes when we try to open Isar the next time. Using the back button on android puts the app into detached state, and resuming back to the app will start from main(), resulting in us opening Isar again and thereby crashing.
    As a workaround, we ignore all the remaining logs in the buffer when the app is moving into the detached state. However, this should be reverted once we move away from Isar

  • We used to log messages in the console when on debug mode. This was missed in the refactor and is added now

@shenlong-tanwen shenlong-tanwen force-pushed the fix/mobile-isar-crash branch from 7df7a79 to 759eaca Compare March 4, 2025 22:39
@alextran1502
Copy link
Contributor

Can you help writing a few words on how you tested this to verify the fix?

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@shenlong-tanwen
Copy link
Member Author

Can you help writing a few words on how you tested this to verify the fix?

Oh, I could reproduce the issue with an emulator, and verified that the above handling fixed the freeze. The basic steps are as follows:

  • Open the app
  • Set the log level to finest
  • Navigation back to the main timeline
  • Use the back button to get out of the app
  • Wait for a second and open it back again for the app to Freeze

After the fix, the app did not freeze at the splash screen, even for finer log levels.

@alextran1502 alextran1502 merged commit 3f4bbab into main Mar 5, 2025
41 checks passed
@alextran1502 alextran1502 deleted the fix/mobile-isar-crash branch March 5, 2025 14:28
zackpollard pushed a commit that referenced this pull request Mar 5, 2025
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
Co-authored-by: Alex <alex.tran1502@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Immich Android version 1.128.0 build 2186 installed from github not resuming from stand by but freezes
2 participants