microsoft / microsoft/BotFramework-WebChat

Uploaded file in Polish appears to be empty

Open
#4,403 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug external-omnichannel p1
Dominant language
HTML
Stars
1.8k
Forks
1.6k
Avg merge
22h 58m
Merged PRs (30d)
2

Description

Is it an issue related to Adaptive Cards?
  • Yes, this is an Adaptive Card issue but it is specific to Web Chat.
Do you have any screenshots?

No response

What version of Web Chat are you using?

I am not using latest

Which distribution are you using Web Chat from?

Bundle (webchat.js)

Which hosting environment does this issue primarily affect?

Web apps

Which browsers and platforms do the issue happened?

Browser: Edge (latest), Browser: Chrome (latest), Browser: Firefox (latest), Browser: Safari (latest), Browser: IE Mode (latest), Platform: Windows, Platform: macOS, Platform: iOS/iPadOS, Platform: Android

Which area does this issue affect?

Attachment: Other rich cards

Is this an accessibility issue?
  • Yes, this is an accessibility issue.
Please describe the bug

This issue repro as early as 4.8.0 (2020 March), and did not repro on 4.7.1 (2019 December).

The technical root cause is:

  • One of our packages downloaded the official Unicode CLDR database
  • The CLDR database it downloaded is inconsistent and causing an exception:
    • The database has two parts to support internationalizing a file size: plural generator and unit formatter, we only use bytes, kilobytes, megabytes, and gigabytes
    • The plural generator turns a number into a plural type
      • In English, it turn 1 -> "one" and any other numbers -> "other" (only 2 types)
      • In Polish, the plural type for number could be "one", "many", "few", and "other" (4 types in total)
    • The unit formatter localize a number into string based on the plural type
      • In English, "one" -> "$1 byte", "other" -> "$1 bytes"
      • In Polish, "one" -> "$1 bajt", etc.
    • The inconsistency:
      • Plural generator return "one", "many", "few", "other" for Polish
      • Unit formatter only support "other"
    • This is causing the unit formatter throwing exception when the number has plural type of "one", "many", or "few"

When the Unicode CLDR is downloaded from https://github.com/unicode-cldr/cldr-units-full/archive/36.0.0.zip, it does not contains one/few/many for short/digital-gigabyte, short/digital-megabyte, and short/digital-kilobyte.

image

However, the supplemental/plurals say Polish do have plural types of one/few/many, as shown below:

image

When we are doing our investigation, we also look at another source of Unicode CLDR, at https://github.com/unicode-org/cldr/blob/release-36/common/main/pl.xml. In this source, we do see short/digital-gigabyte et al. have one/few/many.

image

We concluded the issue is rooted from the Unicode CLDR v36 database. And it is causing globalize package to fail due to the missing strings.

Do you see any errors in console log?

Based on 4.14.1.

image

image

How to reproduce the issue?
  1. Use Polish and talk to MockBot
  2. Upload a file
What is the expected and actual behavior?

Expected: the uploaded file should display properly

Actual: the uploaded file appear to be an empty box

Adaptive Card JSON

No response

Additional context

IcM ticket 332820283 and 330190903.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the attachment upload in Polish with the Web Chat bundle and inspect the console exception reported for version 4.14.1. Compare the downloaded Unicode CLDR v36 data with the newer CLDR revision and the globalize package's plural and unit-formatting inputs; done means the uploaded file renders properly instead of appearing as an empty box.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, localization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.