fix: SSE sync indicator stuck on 'Connexion...' (3 fixes)
1. Move initSyncStatus() AFTER auth check — EventSource was connecting before the access_token cookie was available, causing 401 errors. 2. Reconnect SSE after login — Login form handler now calls IndexUpdateManager.connect() + showWelcome() after successful auth. 3. SSESafeGZipMiddleware — GZip buffering breaks Server-Sent Events streaming. Custom middleware subclass skips compression for /api/events endpoint (path-based bypass).
This commit is contained in:
+7
-1
@@ -1734,6 +1734,10 @@
|
||||
// Load app data after successful login
|
||||
try {
|
||||
await Promise.all([loadVaults(), loadTags()]);
|
||||
// Start SSE sync now that auth cookie is set
|
||||
IndexUpdateManager.connect();
|
||||
// Show dashboard
|
||||
showWelcome();
|
||||
} catch (err) {
|
||||
console.error("Failed to load data after login:", err);
|
||||
}
|
||||
@@ -7818,7 +7822,6 @@
|
||||
initSidebarFilter();
|
||||
initSidebarResize();
|
||||
initEditor();
|
||||
initSyncStatus();
|
||||
initLoginForm();
|
||||
initRecentTab();
|
||||
RightSidebarManager.init();
|
||||
@@ -7829,6 +7832,9 @@
|
||||
const authOk = await AuthManager.initAuth();
|
||||
|
||||
if (authOk) {
|
||||
// Start SSE sync AFTER auth is established (cookie available)
|
||||
initSyncStatus();
|
||||
|
||||
try {
|
||||
await Promise.all([loadVaultSettings(), loadVaults(), loadTags()]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user