Skip to content

feat(dashboards): Register Mobile Session Health prebuilt dashboard#107095

Merged
DominikB2014 merged 1 commit intomasterfrom
dominikbuszowiecki/browse-251-register-mobile-session-health-module-in-the-backend
Jan 29, 2026
Merged

feat(dashboards): Register Mobile Session Health prebuilt dashboard#107095
DominikB2014 merged 1 commit intomasterfrom
dominikbuszowiecki/browse-251-register-mobile-session-health-module-in-the-backend

Conversation

@DominikB2014
Copy link
Contributor

Summary

Register the Mobile Session Health prebuilt dashboard in the backend:

  • Add MOBILE_SESSION_HEALTH = 13 to the PrebuiltDashboardId enum
  • Add dashboard entry to the PREBUILT_DASHBOARDS list with title "Mobile Session Health"

This is part of the mobile session health module migration to the dashboards platform.

Add prebuilt dashboard registration for Mobile Session Health module:
- Add MOBILE_SESSION_HEALTH = 13 to PrebuiltDashboardId enum
- Add dashboard entry to PREBUILT_DASHBOARDS list
@DominikB2014 DominikB2014 requested a review from a team as a code owner January 27, 2026 20:17
@linear
Copy link

linear bot commented Jan 27, 2026

@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 27, 2026
MOBILE_VITALS_SCREEN_LOADS = 10
MOBILE_VITALS_SCREEN_RENDERING = 11
BACKEND_OVERVIEW = 12
MOBILE_SESSION_HEALTH = 13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The backend adds a new prebuilt dashboard (ID 13), but the frontend's PREBUILT_DASHBOARDS configuration is missing an entry for this ID, which will cause a runtime error on render.
Severity: HIGH

Suggested Fix

Ensure the frontend PR that adds the configuration for the MOBILE_SESSION_HEALTH dashboard (ID 13) to the PrebuiltDashboardId enum and PREBUILT_DASHBOARDS record in prebuiltConfigs.tsx is merged and deployed alongside or before this backend change. The code explicitly notes that backend and frontend configs must be kept in sync.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/sentry/dashboards/endpoints/organization_dashboards.py#L77

Potential issue: The backend code introduces a new prebuilt dashboard,
`MOBILE_SESSION_HEALTH`, with an ID of `13`. However, the frontend configuration in
`prebuiltConfigs.tsx` is not updated to include this new dashboard. If this dashboard is
enabled via feature flag or configuration, the backend will create it in the database.
When the frontend attempts to render it, the lookup `PREBUILT_DASHBOARDS[13]` will
return `undefined`. Subsequent code in `prebuiltDashboardRenderer.tsx` that tries to
destructure this `undefined` value (e.g., `const {title, filters} = prebuiltDashboard`)
will throw a runtime error, causing the UI to crash for users viewing this dashboard.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THere will be a frontend PR as well

@DominikB2014 DominikB2014 merged commit 623f106 into master Jan 29, 2026
67 checks passed
@DominikB2014 DominikB2014 deleted the dominikbuszowiecki/browse-251-register-mobile-session-health-module-in-the-backend branch January 29, 2026 13:49
@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants