Home Features Philosophy Docs Blog Errors Security Examples FAQ
DJE-055 Warning WebSocket

Loading state stuck when using _skip_render with push_event

Error message

Button stays in loading/disabled state after push_event

When an event handler uses push_event() with _skip_render = True, the server only sends a push_event message (no patch or HTML response). Previously, the client's loading state manager was only cleared by the response handler (handleServerResponse), so the button's loading indicator was never removed. Fixed in v0.3.0.

bug-fixed liveview loading push-event

Affected versions: <0.3.0

Solution

Before (problematic)
// In 03-websocket.js (old)
case 'push_event':
    window.dispatchEvent(new CustomEvent('djust:push_event', ...));
    break;  // Loading state never cleared!
After (fixed)
// In 03-websocket.js (fixed)
case 'push_event':
    window.dispatchEvent(new CustomEvent('djust:push_event', ...));
    globalLoadingManager.stopLoading(...);
    break;