Description
AuthGuard.canActivate() calls this.http_service.currentLangugae$.subscribe() on every route activation with no corresponding unsubscribe. AuthGuard is a singleton and currentLangugae$ is a BehaviorSubject that never completes, so each navigation to a protected route adds a subscription that is never released.
The subscribed value current_language_set is never read or used anywhere in the guard logic, so the subscription has no effect at all.
Affected routes (7)
All routes using canActivate: [AuthGuard] in app-routing.module.ts:
/service, /servicePoint, /registrar, /nurse-doctor, /lab, /pharmacist, /datasync
Steps to reproduce
- Log in and open DevTools -> Memory tab, take a baseline heap snapshot.
- Navigate between the protected routes above around 10 times.
- Take a second heap snapshot and compare subscriber counts for currentLangugae$.
- Subscriber count grows with each navigation and nothing cleans up.
Validation
- currentLangugae$ is new BehaviorSubject(...).asObservable() in http-service.service.ts and never completes, so subscribers are never auto-released.
- current_language_set is only assigned (line 18), never read anywhere in the file.
- No takeUntil, take(1), or unsubscribe() exists in the class.
Description
AuthGuard.canActivate()callsthis.http_service.currentLangugae$.subscribe()on every route activation with no corresponding unsubscribe.AuthGuardis a singleton andcurrentLangugae$is aBehaviorSubjectthat never completes, so each navigation to a protected route adds a subscription that is never released.The subscribed value
current_language_setis never read or used anywhere in the guard logic, so the subscription has no effect at all.Affected routes (7)
All routes using
canActivate: [AuthGuard]inapp-routing.module.ts:/service,/servicePoint,/registrar,/nurse-doctor,/lab,/pharmacist,/datasyncSteps to reproduce
Validation