[OpenNMS/opennms] 2b2d75: NMS-20174: Don't let blocked localStorage prevent ...

Scott Theleman via opennms-cvs <[email protected]>
Newsgroups gmane.network.opennms.cvs
Message-ID <OpenNMS/opennms/push/refs/heads/jira/NMS-20174-menu-issues-in-ff-and-safari-smoke/[email protected]>
  Branch: refs/heads/jira/NMS-20174-menu-issues-in-ff-and-safari-smoke
  Home:   https://github.com/OpenNMS/opennms
  Commit: 2b2d75d762f9930734c609e31699c9fd1c726d5c
      https://github.com/OpenNMS/opennms/commit/2b2d75d762f9930734c609e31699c9fd1c726d5c
  Author: Scott Theleman <[email protected]>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M ui/src/services/localStorageService.ts
    M ui/src/services/themeService.ts
    A ui/tests/services/localStorageService.test.ts
    A ui/tests/services/themeService.test.ts

  Log Message:
  -----------
  NMS-20174: Don't let blocked localStorage prevent the menu app from mounting

Safari with 'Block all cookies' (and Firefox with cookies disabled)
throws a SecurityError on any window.localStorage access. The menu app
reads localStorage before app.mount() (initTheme) and during SideMenu
component setup (persisted pin state), so the propagated throw aborted
the whole mount, leaving JSP pages with only the :empty CSS skeleton
where the menus belong. Guard the localStorage reads/writes in
themeService and localStorageService with try/catch fallbacks (default
theme / default preferences / skip persisting), matching the guarded
inline theme script in includes/bootstrap.jsp. Also tolerates corrupted
JSON in the preferences key.

Verified via Playwright in WebKit, Firefox and Chromium with a throwing
localStorage shim: the menu now mounts and lays out correctly.



To unsubscribe from these emails, change your notification settings at https://github.com/OpenNMS/opennms/settings/notifications


_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/wiki/index.php?page=MailingListFaq
opennms-cvs mailing list

To *unsubscribe* or change your subscription options, see the bottom of this page:
https://lists.sourceforge.net/lists/listinfo/opennms-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.