Skip to content

fix(slack): Skip dashboard widgets with no type when unfurling - #129704

Closed
joshuarli wants to merge 1 commit into
masterfrom
josh/typing-contracts/b1-slack-null-widget-type
Closed

joshuarli wants to merge 1 commit into
masterfrom
josh/typing-contracts/b1-slack-null-widget-type

Conversation

@joshuarli

Copy link
Copy Markdown
Member

Slack unfurls of dashboard widget links skip a widget whose widget_type is null again, instead of raising AssertionError.

DashboardWidget.widget_type is nullable. Before #129614, a null type missed the _WIDGET_TYPE_TO_CONFIG lookup and was skipped like any other unsupported type. #129614 added assert widget.widget_type is not None to satisfy the dict[int, ...] key type, which turned that skip into an exception. The exception aborts every link in the same unfurl batch. The narrowing is now an explicit continue. build_widget_timeseries_params had the same assert, and it now raises its existing ValueError("Unsupported widget type") for a null type.

Behavior change: restores the behavior from before #129614. A null-type widget is skipped during unfurl rather than failing it, and build_widget_timeseries_params raises ValueError instead of AssertionError for one. test_unfurl_dashboards_null_widget_type_is_skipped fails on master with AssertionError. It shares its body with the existing unsupported-type skip test.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 3, 2026
DashboardWidget.widget_type is nullable. Before #129614 a widget with no
type fell through the config lookup and was skipped like any other
unsupported type. #129614 added `assert widget.widget_type is not None`
to satisfy the dict[int, ...] lookup, so a null-type widget now raises
AssertionError and aborts the whole unfurl batch for that message.

Narrow with an explicit skip instead, and in
build_widget_timeseries_params raise the existing "Unsupported widget
type" ValueError for a null type rather than an AssertionError.
@joshuarli
joshuarli force-pushed the josh/typing-contracts/b1-slack-null-widget-type branch from d75037a to d577989 Compare November 12, 2026 19:02
@joshuarli
joshuarli marked this pull request as ready for review November 12, 2026 19:08
@joshuarli
joshuarli requested a review from a team as a code owner November 12, 2026 19:08
@joshuarli
joshuarli requested a review from vjeranc November 12, 2026 19:08
@joshuarli

Copy link
Copy Markdown
Member Author

Consolidated into #130968 as part of the typing campaign cleanup; code unchanged from the individually validated draft. Tracked in #130956.

@joshuarli joshuarli closed this Nov 12, 2026
joshuarli added a commit that referenced this pull request Nov 26, 2026
…type

Consolidates the previously separate drafts #129616, #129619 and #129704
into one review unit; the code is unchanged from those individually
validated drafts.

- msteams requires the conversation id in the API response
- jira and jira_server require a query before calling the client
- slack unfurl skips dashboard widgets with no widget type instead of
  asserting

Integrated in #130956.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant