Skip to content

Error: Recommendation request is invalid: ["/topics/0/language: must match pattern \"^[a-z]{2,3}(?:-[a-zA-Z]+)?$\""] #209

Description

@sentry

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Observed behavior

The recommendation API embed_topics_request schema does not allow language codes like zh-Hans-CN which exist in our ecosystem.

Sentry Issue: STUDIO-J62

Error: Recommendation request is invalid: ["/topics/0/language: must match pattern \"^[a-z]{2,3}(?:-[a-zA-Z]+)?$\""]
  at SearchOrBrowseWindowvue_type_script_lang_js.computed.shouldShowRecommendations (channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue:442:1)
  at <object>.scopedSlots.fn (./channelEdit/views/ImportFromChannels/SearchOrBrowseWindow.vue:1:555)
  at render (./channelEdit/views/ImportFromChannels/ImportFromChannelsModal.vue:1:1325)
...
(10 additional frame(s) were not displayed)

Expected behavior

The schema should validate against every language code in https://github.com/learningequality/le-utils/blob/main/le_utils/resources/languagelookup.json

A test should be written to verify this.

Metadata

Metadata

Assignees

Labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions