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

Custom mapping is reset while editing unrelated settings in column metadata #43382

Open
zbodi74 opened this issue May 30, 2024 · 2 comments
Open
Labels
Administration/Settings .Frontend Priority:P3 Cosmetic bugs, minor bugs with a clear workaround .Team/AdminWebapp Admin and Webapp team Type:Bug Product defects

Comments

@zbodi74
Copy link

zbodi74 commented May 30, 2024

Describe the bug

Some unrelated actions in the column metadata editor seem to reset the custom field value mappings set for the column.
[Cal's note: the mappings are reset only on the frontend, but the persisted settings are not reset unless the user saves them again]

To Reproduce

  1. In Admin Settings / Table Metadata / Sample Database / Reviews, set up a custom mapping for the Rating column.

  2. Do one of the following:

  • Click on Save, and Exit Admin, then go back to the same place
  • Update an unrelated field in the column settings, such as the column description then click elsewhere so the change is saved
  • Click on Discard cached field values and refresh the page
  • On the table level page, update the title of the same column
  1. (!) The 'Custom mapping' setting reverts to 'Use original value', or the setting remains, but the mapped values reset to the original field values.

Expected behavior

The mapping should be kept.

Logs

No response

Information about your Metabase installation

Reproduced in 1.49.8 and 1.49.13

Severity

Annoying. Found it while trying to reproduce something else.

Additional context

No response

@calherries
Copy link
Contributor

calherries commented May 30, 2024

This is a FE issue so I'm redirecting this to Team/AdminWebApp. The request to update the field values (POST /api/field/:id/values) does the job, so this is a FE issue. After refreshing the page, the updated settings are persisted. But if you do any of the above in step 2 the FE is incorrectly using cached settings that should have been updated or invalidated.

So the title of the issue is a little misleading, because the changes to the custom mapping is only reset on the FE, but the custom mapping is actually saved correctly on the BE. Because of this, I'd say this is more like a P3 than P2. It's not blocking any functionality but it is certainly showing incorrect information to users.

@calherries calherries added Priority:P3 Cosmetic bugs, minor bugs with a clear workaround and removed Priority:P2 Average run of the mill bug labels May 30, 2024
@zbodi74
Copy link
Author

zbodi74 commented May 31, 2024

I just noticed, editing the name or description of the column at the table level page also persists the change. So I'd vote for P2 as the mapping might be cleared out even without a visible change on the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Administration/Settings .Frontend Priority:P3 Cosmetic bugs, minor bugs with a clear workaround .Team/AdminWebapp Admin and Webapp team Type:Bug Product defects
Projects
None yet
Development

No branches or pull requests

3 participants