The issue reported: "AI summary is now great. visualisation and hyperlinks from notification still don't work" and "it has never opened to the webui"
We identified TWO separate problems:
- Issue: Notification links were being generated for ALL component types (addons, core, supervisor, OS updates)
- Why it failed: The dependency graph only tracks integrations and HACS components, not addons or system components
- Example failure: When user clicked link to "mosquitto" addon, the web UI couldn't find it because mosquitto addon is not in the integration dependency graph
- Issue: Links used URL fragments like
/api/hassio_ingress/ha_sentry#whereused:component - Why it failed: Home Assistant's persistent notification system doesn't preserve URL fragments (the
#part) - Result: Links would navigate to the base URL but the deep linking wouldn't trigger - the visualization would never show
Changed in: sentry_service.py (lines 691-699)
Before:
if self.config.enable_web_ui and component_name != 'Unknown':
# Generate link for ALL components
where_used_url = self._get_ingress_url() + f"#whereused:{component_domain}"
notification_message += f" [🔍 View Impact]({where_used_url})\n"After:
if (self.config.enable_web_ui and
component_name != 'Unknown' and
component_type in ['integration', 'hacs']): # Only for tracked types!
where_used_url = self._get_ingress_url(mode="whereused", component=component_domain)
notification_message += f" [🔍 View Impact]({where_used_url})\n"Result: Links are now only generated for integrations and HACS components, not for addons/core/supervisor/OS
Changed in: sentry_service.py and web_server.py
Before:
URL format: /api/hassio_ingress/ha_sentry#whereused:mosquitto
Problem: Home Assistant strips the #whereused:mosquitto part
After:
URL format: /api/hassio_ingress/ha_sentry?mode=whereused&component=mosquitto
Solution: Query parameters are preserved in Home Assistant notifications!
Implementation:
-
URL Generation (
sentry_service.py):def _get_ingress_url(self, path: str = "", mode: str = "", component: str = "") -> str: base_url = f"/api/hassio_ingress/{self.ADDON_SLUG}" params = [] if mode: params.append(f"mode={mode}") if component: params.append(f"component={quote(component)}") if params: base_url = f"{base_url}?{'&'.join(params)}" return base_url
-
URL Parsing (
web_server.py):function handleUrlFragment() { // Check for query parameters first (more reliable) const urlParams = new URLSearchParams(window.location.search); const mode = urlParams.get('mode'); const component = urlParams.get('component'); if (mode && component) { handleDeepLink(mode, component); return; } // Fallback to hash fragment for backward compatibility const hash = window.location.hash.substring(1); if (hash) { const [fragmentMode, value] = hash.split(':'); handleDeepLink(fragmentMode, value); } }
When a component is not found, users now see helpful messages:
- "It's an add-on or system component (not tracked in dependency graph)"
- "It's not installed on your system"
- "The component name doesn't match the integration domain"
- "Try selecting a component manually from the dropdown instead"
Added logging at key points:
- URL fragment/query parameter parsing
- Component lookup success/failure
- Deep link handling
Notification content:
🟡 **custom_integration (HACS Integration)**
Major update: 1.0.0 → 2.0.0
[🔍 View Impact](/api/hassio_ingress/ha_sentry?mode=whereused&component=custom_integration)What happens when clicked:
- Browser navigates to:
/api/hassio_ingress/ha_sentry?mode=whereused&component=custom_integration - Web UI parses query parameters:
mode=whereused,component=custom_integration - Switches to "Where Used" mode
- Selects
custom_integrationin dropdown - Automatically triggers visualization
- User sees the dependency graph!
Notification content:
🟠 **mosquitto (Add-on)**
MQTT broker update: 2.0.15 → 2.0.18No link generated because:
component_type = 'addon'- Addons are not in the dependency graph
- Link would fail anyway, so we don't create it
Created comprehensive tests:
- test_notification_links.py - Validates URL generation and parsing
- test_notification_link_fix.py - Validates link generation logic
Test Results: All 21 test cases PASS ✅
The web UI still supports the old URL fragment format for:
- Direct browser bookmarks
- Old notification links (if any exist)
- Manual URL construction
Both formats work:
- New:
/api/hassio_ingress/ha_sentry?mode=whereused&component=test - Old:
/api/hassio_ingress/ha_sentry#whereused:test
❌ Clicking notification links did nothing ❌ Links generated for addons that aren't tracked ❌ No way to jump directly to component analysis from notifications
✅ Clicking notification links opens the WebUI with the correct visualization ✅ Links only generated for components that are actually tracked ✅ Deep linking works reliably from Home Assistant notifications ✅ Improved error messages when something isn't found ✅ Better diagnostic logging for troubleshooting
-
ha_sentry/rootfs/app/sentry_service.py- Modified
_get_ingress_url()to use query parameters - Updated link generation to filter by component type
- Moved import to top of file
- Modified
-
ha_sentry/rootfs/app/web_server.py- Added
URLSearchParamsquery parameter parsing - Created
handleDeepLink()function - Added diagnostic logging
- Improved error messages
- Added
-
ha_sentry/CHANGELOG.md- Documented the changes
-
tests/test_notification_links.py- Updated tests for query parameter format
-
tests/test_notification_link_fix.py- Created comprehensive validation tests
✅ Links only generated for integration and HACS types ✅ URLs use query parameters instead of fragments ✅ Web UI parses query parameters correctly ✅ Web UI maintains backward compatibility with fragments ✅ Error messages are helpful and actionable ✅ All tests pass (21/21) ✅ Code review feedback addressed ✅ CHANGELOG updated
-
Test the fix:
- Wait for an update notification
- Click the "View Impact" link
- Verify it opens the WebUI with the visualization
-
If it still doesn't work:
- Check add-on logs for diagnostic messages
- Look for lines starting with "handleDeepLink called"
- Report the specific error message
-
Alternative access:
- You can always access the WebUI via:
- "Sentry" panel in Home Assistant sidebar
- Settings → Add-ons → Home Assistant Sentry → Open Web UI
- You can always access the WebUI via:
The fix addresses the fundamental issue that notification links were using a URL format that Home Assistant doesn't support. By switching to query parameters, the links now work correctly and users can click directly from notifications to see component analysis in the WebUI.
The fix is minimal, surgical, and focused on solving the specific problem while maintaining backward compatibility and adding helpful diagnostics for future troubleshooting.