Bugfix: How to fix Angular effect() causing browser freeze with Load...
Documentation for Sessions
🐛 Bugfix: How to fix Angular effect() causing browser freeze with Load...
Date: 2026-01-29
Time: 20:08:27 UTC
Session: editor2-73.32
Agent: angular
Confidence: 100%
Status: ✅ Documented
📋 Decision Context
Question:
How to fix Angular effect() causing browser freeze with LoadingOverlayService?
Task: Fix docs-angular browser freeze on root URL
🎯 Decision Made
Chosen:
Track overlay state with separate signal to prevent re-entry
Options Considered:
- Debounce the effect
- Track overlay state with separate signal to prevent re-entry
- Remove the effect entirely
💭 Reasoning
The AppComponent effect was reading appLoadingService.currentMessage() which cycles every 2.5s. Each cycle triggered showOverlay() which accumulated setInterval timers, consuming 100% CPU. The fix: add _overlayShown signal, call showOverlay() only when isLoading becomes true AND overlay not shown, call hideOverlay() only when isLoading becomes false AND overlay was shown. This prevents the effect from reacting to message changes.
📁 Files Involved
apps/docs-angular/src/app/app.component.tslibs/libs-ux/ux-loading/README.mddocs/english/Docs-angular/troubleshooting/page-freeze-overlay-effect-bug.md
🔗 Related
- Decision ID:
dev_1769717307412_oten4lb - Session: 73
- Workspace: editor2
Auto-generated by MCP Smart Consolidation