Skip to content

fix(pharmacist): stop silent failure when redirecting to Inventory - #282

Merged
vishwab1 merged 1 commit into
release-3.8.1from
sn/fix-pharmacist-inventory-redirect-3.8.1
Aug 4, 2026
Merged

fix(pharmacist): stop silent failure when redirecting to Inventory#282
vishwab1 merged 1 commit into
release-3.8.1from
sn/fix-pharmacist-inventory-redirect-3.8.1

Conversation

@snehar-nd

Copy link
Copy Markdown
Contributor

Summary

  • InventoryService.current_language_set was declared but never assigned. Whenever the redirect guard (authKey && protocol && host && facility) failed for any reason, the else branch tried to read this.current_language_set.alerts.info.noFacilityMapper and threw a TypeError, silently killing the whole flow before any alert or redirect happened — clicking the pharmacist worklist action looked like it did nothing.
  • Fixed by populating current_language_set from HttpServiceService.currentLangugae$, the same pattern already used in AuthGuard.
  • getppID() called JSON.parse(serviceLineDetails).parkingPlaceID with no null check — if serviceLineDetails wasn't in session storage, this threw before the redirect could fire. Added a guard.
  • worklist.component.ts checked sessionStorage.getItem('setLanguage') !== undefined, which is always true since getItem returns null, not undefined, for a missing key — so the 'English' fallback could never trigger. Fixed to check !== null.

Test plan

  • From the pharmacist worklist, trigger the dispense/redirect action and confirm the confirmation dialog appears and, on confirm, the app attempts navigation to the Inventory app instead of silently doing nothing
  • Verify the "no facility mapped" alert now displays correctly (instead of throwing) when facility/auth session data is missing

🤖 Generated with Claude Code

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).
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fd806b7b-a8a5-4a28-82d5-2a2e8065b13c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@vishwab1
vishwab1 merged commit 123728e into release-3.8.1 Aug 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants