added frontend notification on failed migration
authorPhiTux <redacted>
Mon, 13 Oct 2025 09:14:32 +0000 (11:14 +0200)
committerPhiTux <redacted>
Mon, 13 Oct 2025 09:14:32 +0000 (11:14 +0200)
README.md
backend/version
frontend/src/i18n/de.json
frontend/src/i18n/en.json
frontend/src/routes/login/+page.svelte

index 13448693c154fb380f8d20e3cbef57a053660a13..7fc61f1481ca71a1ba796f827a3670fb42291d88 100644 (file)
--- a/README.md
+++ b/README.md
@@ -165,6 +165,9 @@ The old version 1 is moved to the [v1 branch](https://github.com/PhiTux/DailyTxT
 
 ### Newest Testing Versions:
 ```
+2.0.0-testing.3 (2025-10-13)
+- Updated the migration process in the frontend. When migration fails on serverside, the user now gets notified.
+
 2.0.0-testing.2 (2025-10-13)
 - Trying to fix a bug in the migration process by removing unnecessary code (that should validate some data, but was probably harmful instead).
 ```
index 343d310ab15eea112c1f33b9c4bd9cd5c51db2e5..5570fd77a32ecfd567b43a4de4529bf90742c129 100644 (file)
@@ -1 +1 @@
-2.0.0-testing.2
+2.0.0-testing.3
index 99c3337f0f329e10c6eec3bd2c2c00aed88e84f3..28d3606e970f5bbe17ed464cc4e338d38ef4c4d1 100644 (file)
@@ -73,6 +73,7 @@
     "alert": {
       "empty_fields": "Eingabefelder dürfen nicht leer sein!",
       "login_failed": "Login fehlgeschlagen!<br />\nBitte Eingabedaten überprüfen.",
+      "migration_failed": "Die Migration ist fehlgeschlagen! Schaue in den Serverlogs nach (z. B. mit <code>docker logs dailytxt</code>), ob du dort genauere Informationen findest!",
       "passwords_do_not_match": "Passwörter stimmen nicht überein!",
       "registration_allowed_until": "Registrierung temporär geöffnet bis {date_and_time} (Serverzeit).",
       "registration_failed": "Registrierung fehlgeschlagen - bitte Fehlermeldungen analysieren!",
index 3ab6c52f339658cb01b8e4de80c7ae50ee37cbd3..ecf09ef2ec4efeca65e3f210e3f4d4fa7a49d748 100644 (file)
@@ -73,6 +73,7 @@
     "alert": {
       "empty_fields": "Fields must not be empty!",
       "login_failed": "Login failed!<br />\nPlease check your input data.",
+      "migration_failed": "The migration failed! Check the server logs (e.g., with <code>docker logs dailytxt</code>) to see if you can find more detailed information there!",
       "passwords_do_not_match": "Passwords do not match!",
       "registration_allowed_until": "Registration temporarily open until {date_and_time} (Server time).",
       "registration_failed": "Registration failed - please analyze the error messages!",
index ebded22044f7a0d1ed5fccfe34d2e7911dce4253..fa715620748da35d7e69acc72a34b0c73cefcb3f 100644 (file)
                        });
        }
 
+       let show_migration_failed = $state(false);
        function handleMigrationProgress(username) {
                // Poll the server for migration progress
                const interval = setInterval(() => {
 
                                        if (
                                                !response.data.migration_in_progress &&
-                                               !response.data.progress.phase === 'not_started'
+                                               response.data.progress?.phase !== 'not_started' &&
+                                               response.data.progress?.phase !== 'completed'
                                        ) {
                                                console.log('Migration stopped');
                                                is_migrating = false;
+                                               show_migration_failed = true;
                                                clearInterval(interval);
                                        }
                                })
                show_login_failed = false;
                show_login_warning_empty_fields = false;
                is_migrating = false;
+               show_migration_failed = false;
 
                const username = document.getElementById('loginUsername').value;
                const password = document.getElementById('loginPassword').value;
                                                                        {/if}
                                                                </div>
                                                        {/if}
+                                                       {#if show_migration_failed}
+                                                               <div class="alert alert-danger" role="alert">
+                                                                       {@html $t('login.alert.migration_failed')}
+                                                               </div>
+                                                       {/if}
                                                        {#if show_login_failed}
                                                                <div class="alert alert-danger" role="alert">
                                                                        {@html $t('login.alert.login_failed')}
git clone https://git.99rst.org/PROJECT