parseUserAgent in ProfilePage.jsx has weak OS detection #56

Open
opened 2026-05-16 21:43:25 -05:00 by null · 0 comments
Owner

Severity: LOW 🔵

Affected Files

  • client/pages/ProfilePage.jsxparseUserAgent()

Problem

The OS extraction in parseUserAgent() only checks a handful of UA strings. Modern Linux desktops, ChromeOS, and some Android OEM user agents would fall through to null OS and no icon. The login history modal would show an empty OS field for these users.

Current detection patterns (approximate):

  • Windows → checks for Win
  • macOS → checks for Mac
  • Android → checks for Android
  • iOS → checks for iPhone/iPad
  • Linux → checks for Linux

Missing: ChromeOS, Fedora/Ubuntu/Debian distro strings, some Android OEM UAs.

Impact

  • Login history shows empty OS for ChromeOS, some Linux distros, and some Android devices
  • Low risk — just a cosmetic gap in the login history modal

Fix

Add fallback patterns for ChromeOS (CrOS) and common Linux distros. If OS is null after all checks, fallback to a generic "Unknown" label rather than showing nothing.

Acceptance Criteria

  • ChromeOS users see "ChromeOS" in login history
  • Linux desktop users see "Linux" (at minimum)
  • Unknown OS shows "Unknown" instead of blank
## Severity: LOW 🔵 ## Affected Files - `client/pages/ProfilePage.jsx` — `parseUserAgent()` ## Problem The OS extraction in `parseUserAgent()` only checks a handful of UA strings. Modern Linux desktops, ChromeOS, and some Android OEM user agents would fall through to `null` OS and no icon. The login history modal would show an empty OS field for these users. Current detection patterns (approximate): - Windows → checks for `Win` - macOS → checks for `Mac` - Android → checks for `Android` - iOS → checks for `iPhone`/`iPad` - Linux → checks for `Linux` Missing: ChromeOS, Fedora/Ubuntu/Debian distro strings, some Android OEM UAs. ## Impact - Login history shows empty OS for ChromeOS, some Linux distros, and some Android devices - Low risk — just a cosmetic gap in the login history modal ## Fix Add fallback patterns for ChromeOS (`CrOS`) and common Linux distros. If OS is null after all checks, fallback to a generic "Unknown" label rather than showing nothing. ## Acceptance Criteria - [ ] ChromeOS users see "ChromeOS" in login history - [ ] Linux desktop users see "Linux" (at minimum) - [ ] Unknown OS shows "Unknown" instead of blank
null added the
frontend
priority:nice-to-have
labels 2026-05-16 21:43:25 -05:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: null/BillTracker#56
No description provided.