Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard width revision message should handle nil #39710

Conversation

adam-james-v
Copy link
Contributor

Fixes: #38910

Even though there shouldn't be nil values in :width keys on the dashboard, (because the migration populates w/ the default value of full), it is still true that because of the version before the migration, revisions can have nil for the width
value. The diff string impl didn't consider this, causing an NPE with (name nil).

This change should guard the diff string from trying to run on these nil values.

Even though there shouldn't be `nil` values in dashboard.width, because the migration populates w/ the default value
of `full`, it is still true that because of the version before the migration, revisions  can have `nil` for the width
value. The diff string impl didn't consider this, causing an NPE with `(name nil)`.
@metabase-bot metabase-bot bot added the .Team/DashViz Dashboard and Viz team label Mar 6, 2024
Copy link

replay-io bot commented Mar 6, 2024

Status Complete ↗︎
Commit 7434ee6
Results
⚠️ 3 Flaky
2329 Passed

@adam-james-v adam-james-v added the backport Automatically create PR on current release branch on merge label Mar 6, 2024
Copy link
Member

@camsaul camsaul left a comment

Choose a reason for hiding this comment

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

change looks good, but can we please get a test for this? We like tests in these here parts

@adam-james-v
Copy link
Contributor Author

change looks good, but can we please get a test for this? We like tests in these here parts

@camsaul, I made a slight modification and added a test. It's probably still ok, but a quick second look might be good, if you have a second.

@adam-james-v adam-james-v merged commit 0ea86ea into master Mar 7, 2024
106 checks passed
@adam-james-v adam-james-v deleted the bugfix-38910-dashboard-width-revision-message-should-handle-nil branch March 7, 2024 19:08
Copy link

github-actions bot commented Mar 7, 2024

@adam-james-v Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone?

github-actions bot pushed a commit that referenced this pull request Mar 7, 2024
* Revision Diff Should handle `nil` Dashboard Width

Even though there shouldn't be `nil` values in dashboard.width, because the migration populates w/ the default value
of `full`, it is still true that because of the version before the migration, revisions  can have `nil` for the width
value. The diff string impl didn't consider this, causing an NPE with `(name nil)`.

* Use :guard to prevent nil values from matching

* Add test checking that dashboard width change is described correctly
metabase-bot bot added a commit that referenced this pull request Mar 7, 2024
* Revision Diff Should handle `nil` Dashboard Width

Even though there shouldn't be `nil` values in dashboard.width, because the migration populates w/ the default value
of `full`, it is still true that because of the version before the migration, revisions  can have `nil` for the width
value. The diff string impl didn't consider this, causing an NPE with `(name nil)`.

* Use :guard to prevent nil values from matching

* Add test checking that dashboard width change is described correctly

Co-authored-by: adam-james <21064735+adam-james-v@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Automatically create PR on current release branch on merge .Team/DashViz Dashboard and Viz team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unknown error in the revision history of a dashboard leads to a NullPointerException
2 participants