feat(mobile): display error on app init fail#22758
Closed
denysvitali wants to merge 3 commits intoimmich-app:mainfrom
Closed
feat(mobile): display error on app init fail#22758denysvitali wants to merge 3 commits intoimmich-app:mainfrom
denysvitali wants to merge 3 commits intoimmich-app:mainfrom
Conversation
Member
|
Although the core issue is fixed in #22757, it might not be a bad idea to have some sort of error page such as this. |
Comment on lines
+181
to
+198
| // Restart button | ||
| ElevatedButton.icon( | ||
| onPressed: () { | ||
| // Attempt to restart the app | ||
| if (Platform.isAndroid || Platform.isIOS) { | ||
| exit(0); | ||
| } | ||
| }, | ||
| icon: const Icon(Icons.close), | ||
| label: const Text('Close App'), | ||
| style: ElevatedButton.styleFrom( | ||
| backgroundColor: theme.colorScheme.error, | ||
| foregroundColor: theme.colorScheme.onError, | ||
| padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12), | ||
| ), | ||
| ), | ||
| ], | ||
| ), |
Member
There was a problem hiding this comment.
Let's not have a restart button. Apple recommends against calling exit programatically
https://developer.apple.com/library/archive/qa/qa1561/_index.html
Can you also fix the failing static analysis?
shenlong-tanwen
requested changes
Dec 9, 2025
Member
shenlong-tanwen
left a comment
There was a problem hiding this comment.
Can you localise the strings used in the PR and make the other reviewed changes after rebasing this over main?
Comment on lines
+31
to
+35
| Image.asset( | ||
| 'assets/immich-logo.png', | ||
| width: 80, | ||
| height: 80, | ||
| ), |
Member
There was a problem hiding this comment.
There is an ImmichLogo widget available
Member
|
The core team is working on an error page to handle init failures. We are going to close this in favor of that one. Thank you for the contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Before this change, the application, in case of error, was silently failing.
In my case, the missing
IsarCorelibrary caused the app to be constantly restarted (result = stuck at the Immich logo forever) without any message on screen or on the console.This fixes a similar behavior like #1815 and #2005 - in that case the user was not able to report an additional information due to the missing error handling. Ironically, in that case the cause of failure was the same as mine - but it wasn't immediately clear to me (actually, it took me several hours to debug) on what was causing it.
With this PR, we now have a proper error handling in case of init failures.
TL;DR:
How Has This Been Tested?
Runned the app in debug mode on my device.
Screenshots (if appropriate)
Checklist:
src/services/uses repositories implementations for database calls, filesystem operations, etc.src/repositories/is pretty basic/simple and does not have any immich specific logic (that belongs insrc/services/)Please describe to which degree, if any, an LLM was used in creating this pull request.
Pretty much all done with Z.AI's GLM-4.6 - minor corrections here and there.