-
Notifications
You must be signed in to change notification settings - Fork 826
Feature: Database-backed Failed Updates Screen with mass migration #2714
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
base: main
Are you sure you want to change the base?
Feature: Database-backed Failed Updates Screen with mass migration #2714
Conversation
Introduces a new system for tracking manga update errors, including database schema, repository, domain models, and interactors. Adds a dedicated 'Failed Updates' screen and tab, integrates error count and navigation into the updates UI, and updates notification handling to link to the new screen. Cleans up errors for non-favorite manga and provides migration and clear-all actions for failed updates.
|
As general feedback: All strings must be proper i18n strings, otherwise the strings couldn't be translated into Mihon's many community-maintained languages. I have not taken a look at the actual logic nor am I in a position to make decisions over this feature, but that is an important thing to keep in mind in this project. There may be pre-existing strings you can reuse, take a look around in the base strings file. |
Thanks for the information, I just also noticed them and was about to make a commit xD |
Replaced hardcoded strings in FailedUpdatesScreen with localized resources for actions and error messages. Added new string resources for 'Migrate Selected' and confirmation dialog text to improve internationalization.
|
in commit 34dc31e also fixed "Migration Button" position when user has navigationbar |
Corrected the indentation of section comments throughout the strings.xml how it was before Thought I accidentally pushed them forward
… Failed Screen Also replaced hardcoded strings with stringResource for 'Clear error' and 'Failed Updates' labels
app/src/main/java/eu/kanade/presentation/updates/UpdatesScreen.kt
Outdated
Show resolved
Hide resolved
Introduces the ability to delete selected failed update errors from the list. Adds a confirmation dialog, updates UI components, and provides necessary string resources for the new action.
Introduces a new plural string resource for failed updates and updates the UpdatesScreen to use it for displaying the failed updates count in a localized, pluralized format.
app/src/main/java/eu/kanade/presentation/failedupdate/FailedUpdatesScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/eu/kanade/presentation/failedupdate/FailedUpdatesScreen.kt
Outdated
Show resolved
Hide resolved
app/src/main/java/eu/kanade/tachiyomi/ui/failedupdate/FailedUpdatesScreenModel.kt
Outdated
Show resolved
Hide resolved
Replaces the custom formatTimestamp function with the already existing relativeDateText component for displaying error timestamps in FailedUpdatesScreen.
Introduces a new string resource for the failed updates empty state and updates FailedUpdatesScreen to use it instead of the library empty message.
… use already existing function
Replaces 'return true' with 'null' when handling the failed updates shortcut, ensuring correct navigation behavior in MainActivity.
Replaces the hardcoded 'View Log' string in the LibraryUpdateNotifier notification action with a localized resource. Adds 'action_view_log' to the strings.xml for proper localization support.
Changed the app bar action title from 'Migrate' to 'Select All'
Replaced manual filtering and removal of invalid manga selections with a single retainAll call for improved clarity and efficiency.
Updated the comment to specify that non-favorite errors are cleaned up when the screen is opened, improving code clarity.
Refactored the deleteNonFavorites SQL statement to use a NOT IN clause for improved readability and efficiency. The new query deletes errors for manga that are not marked as favorites.
Deletes any previous update error for a manga after a successful update in LibraryUpdateJob. This ensures that resolved errors are removed and only current issues are tracked.
Introduces an onClickItem callback to FailedUpdatesScreen and its related components, allowing navigation to the migration config screen when an item is clicked. This enhances user interaction by providing direct access to migration for individual manga from the failed updates list.
Introduces an isHappy parameter to EmptyScreen, allowing it to display happy emoticons for positive empty states. Updates FailedUpdatesScreen to use this feature when showing an empty state for failed updates. Ensured that the EmptyScreen is still backwards compatible.
|
Just noticed in the #1381 there was a problem where individual manga updates weren't weren't updated for errors, so I checked my code and I forgot to add deleteMangaUpdateError in MangaScreenModel.kt too. Will add it and hopefully should be complete and ready |
Adds logic to insert update errors into the database when a manga update fails and the manga is favorited, and to delete previous errors when an update succeeds.
|
Updated PR at top |
Swapped LazyColumn for FastScrollLazyColumn in FailedUpdatesList to enable fast scrolling functionality for the failed updates screen.
Replaces Card with Row for FailedUpdateItem, updates selection visuals to use alpha, and adjusts padding and arrangement. Improves consistency with app design and simplifies item interaction logic.
Changed the insert statement for manga_update_errors to only update existing records if the error_message has changed, preventing unnecessary overwrites and preserving correct timestamps
|
Found no other issues and works stable now. |
Added entries for the 'Failed Updates' screen and happy emotes on positive empty screens under the Unreleased section. These changes document recent feature additions and UI improvements.
This is my first PR to the project, so feedback is definitely welcome.
I picked this up because the earlier attempt in #1381 hasn’t been updated in a long time, and I wanted to help move the feature forward.
This PR adds a dedicated Failed Updates screen and moves update error tracking into the database, while keeping the legacy log file for compatibility.
It aims to fully implement feature requests #132 and #2158.
Summary
New Failed Updates screen
A new composable
FailedUpdatesScreenshows all failed library update entries in a proper UI instead of hiding them in a text file.Key capabilities:
At this stage, the screen does not support search or grouping. The goal is to land the core UX first; search/grouping can follow in a separate PR once this one is settled.
Database-backed error logging
LibraryUpdateJobnow writes failures into the database through anInsertMangaUpdateErroruse case, making them:The legacy log file is still written to maintain compatibility:
mihon_update_errors.txtremains unchanged in behaviorThis makes the database the primary source for the UI while keeping the text file for anyone who prefers it.
Notifications → deep link
Failed update notifications now deep link directly into the new screen:
To support this,
NotificationReceivernow provides:openFailedUpdatesPendingActivity(...)— an intent helper to navigate to the new screenThis makes failed updates visible for everyday users without breaking the old workflow.
User-facing behavior
Implementation notes
Main changes:
FailedUpdatesScreenand related UI logicLibraryUpdateJobto:isHappy = trueit shows happy emotesThe design follows existing architecture patterns to keep everything consistent.
Testing
Executed manual testing on an emulator:
mihon_update_errors.txtCurrent error coverage:
More scenarios can be tested later if needed.
Screenshots & video
Light mode
Dark mode
Video (full flow)
Demonstrates:
Screen.Recording.20251120.052535-done.webm
Issue links
Closes #132
Closes #2158