fix(pharmacist): stop silent failure when redirecting to Inventory - #282
Conversation
InventoryService.current_language_set was declared but never assigned, so the guard's error-alert branch threw instead of showing a message whenever authKey/facility/host was missing — masking the real problem and making the redirect look like a no-op. Populate it from HttpServiceService.currentLangugae$, the same pattern AuthGuard already uses. Also guard getppID() against a missing serviceLineDetails entry (JSON.parse(null).parkingPlaceID threw before the redirect could fire), and fix the setLanguage fallback check in worklist.component (sessionStorage.getItem returns null, never undefined).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Summary
InventoryService.current_language_setwas declared but never assigned. Whenever the redirect guard (authKey && protocol && host && facility) failed for any reason, theelsebranch tried to readthis.current_language_set.alerts.info.noFacilityMapperand threw aTypeError, silently killing the whole flow before any alert or redirect happened — clicking the pharmacist worklist action looked like it did nothing.current_language_setfromHttpServiceService.currentLangugae$, the same pattern already used inAuthGuard.getppID()calledJSON.parse(serviceLineDetails).parkingPlaceIDwith no null check — ifserviceLineDetailswasn't in session storage, this threw before the redirect could fire. Added a guard.worklist.component.tscheckedsessionStorage.getItem('setLanguage') !== undefined, which is always true sincegetItemreturnsnull, notundefined, for a missing key — so the'English'fallback could never trigger. Fixed to check!== null.Test plan
🤖 Generated with Claude Code