Skip to content

Conversation

@akolson
Copy link
Member

@akolson akolson commented Oct 10, 2025

…opdown

Summary

This pr adds a defensive on the code for the error reported in sentry as detailed here. The bug is triggered when trying to edit multiple resources with differing languages.

References

Fixes #5434

Reviewer guidance

  • Use any of the LanguageDropdowns in any of the pages in studio
  • Ensure no regressions in behavior
  • Check logs to ensure above logs are not reported
  • Regression tests have also been added, so should pass.

@akolson akolson added this to the Studio: October 2025 Patches milestone Oct 10, 2025
@akolson akolson added P2 - normal Priority: Nice to have and removed P1 - important Priority: High impact on UX labels Oct 10, 2025
languageText(item) {
const firstNativeName = item.native_name.split(',')[0].trim();
const nativeName = item?.native_name || '';
const firstNativeName = nativeName.split(',')[0].trim();
Copy link
Member

Choose a reason for hiding this comment

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

I think similarly to the node title defensive check, we should be trying to understand why this is happening and whether it's indicative of another issue. I imported shared/leUtils/Languages.js in a Node REPL and all of them had a native_name.

> Array.from(LanguagesMap.values()).filter(l => !l.native_name)
[]

Also, in the Studio database, all languages have it too.
image

Copy link
Member Author

Choose a reason for hiding this comment

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

The bug is triggered when trying to edit multiple resources with differing languages. In such cases, and empty object ({}) is returned, thus the bug. The above should be an acceptable fix, I think. However, I have posted here for designers to have their thoughts on UX.

Copy link
Member

Choose a reason for hiding this comment

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

We'll see what design says. If they prefer to keep it as is, perhaps we can use a Symbol to explicitly handle this situation, which will be specific enough that we wouldn't suppress any other possible issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

Based on designs recommendation, a "new" language "Mixed (Mix)" will be added Languages.vue. The wording could change after string review but should be sufficient for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Update: Looks like we don't need to add a new type afterall. We already have "Multiple languages (mull)" option in places.

@bjester bjester self-assigned this Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants