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

mozilla.slack.com - site is not usable - menu buttons don't work in Firefox version "100" #67866

Closed
cpeterso opened this issue Mar 4, 2021 · 9 comments
Labels
browser-firefox engine-gecko The browser uses the Gecko rendering engine priority-important priority-normal severity-important A non-core broken piece of functionality, not behaving the way you would expect. type-ua-3digits version100 label for browser with version 100 in their UA string
Milestone

Comments

@cpeterso
Copy link

cpeterso commented Mar 4, 2021

URL: https://mozilla.slack.com/

Browser / Version: Firefox 100.0
Operating System: Windows 10
Tested Another Browser: No

Problem type: Site is not usable
Description: Buttons or links not working
Steps to Reproduce:
To find websites that break if the User-Agent string's browser version number has three digits (see Firefox bug 1672445), I set my Firefox's general.useragent.override pref to Mozilla/5.0 (Windows NT 10.0; rv:100.0) Gecko/20100101 Firefox/100.0, spoofing that I have Firefox version 100.

I discovered Slack's message popup menu's buttons (such as "Add reaction" or "Reply in thread") stop working for Firefox versions >= 100 and <= 519. They mysteriously start working again for versions >= 520.

The Firefox UA string has two Firefox numbers: rv:100.0 and Firefox/100.0. The second number (Firefox/100.0) is the one that is breaking Slack. If I set my UA string to Mozilla/5.0 (Windows NT 10.0; rv:86.0) Gecko/20100101 Firefox/100.0, the menu buttons are broken. If I set my UA string to Mozilla/5.0 (Windows NT 10.0; rv:100.0) Gecko/20100101 Firefox/86.0, the menu buttons work correctly.

View the screenshot Screenshot
Browser Configuration
  • None

From webcompat.com with ❤️

@webcompat-bot webcompat-bot added this to the needstriage milestone Mar 4, 2021
@webcompat-bot webcompat-bot added browser-firefox engine-gecko The browser uses the Gecko rendering engine priority-important labels Mar 4, 2021
@cpeterso cpeterso changed the title mozilla.slack.com - site is not usable mozilla.slack.com - site is not usable - menu buttons don't work in Firefox version "100" Mar 4, 2021
@softvision-oana-arbuzov softvision-oana-arbuzov added priority-normal severity-important A non-core broken piece of functionality, not behaving the way you would expect. labels Mar 5, 2021
@softvision-oana-arbuzov
Copy link
Member

Thanks for the report, I was able to reproduce the issue.
MenuBroken

Tested with:
Browser / Version: Firefox Nightly 88.0a1 (2021-03-03)
Operating System: Windows 10 Pro

Moving to Needsdiagnosis for further investigation.

@karlcow
Copy link
Member

karlcow commented Mar 11, 2021

So in a normal browsing context.

Capture d’écran 2021-03-11 à 11 11 20

There are 60 instances of userAgent in Slack Web version.

I poked around and I found

* UAParser.js v0.7.23
 * Lightweight JavaScript-based User-Agent string parser
 * https://github.com/faisalman/ua-parser-js
 *
 * Copyright © 2012-2019 Faisal Salman <f@faisalman.com>
 * Licensed under MIT License
 */

but this is not the only parser they used. In fact each libraries come with their own.

This is will be probably painful to debug.

@karlcow
Copy link
Member

karlcow commented Mar 11, 2021

@wisniewskit it would be great if you could poke at it today. I tried and failed. I searched for pattern \d\d or \d{2}. My hunch is that at the start of the app, there is a bunch of initialisations based on user agent sniffing. And then it breaks later on a feature for opening the modal pop up for features.

@wisniewskit
Copy link
Member

My instincts suggested that this is likely happening because of a comparison treating numbers as strings ("100" is smaller than "99"), so I poked around looking for that. Sure enough it looks like the problem is here in this giant minified script:

  const _ = c.a.firefox && c.a.version < '52' || c.a.safari && c.a.version < '11' ? h : 'button',

Since the string "100" compares as smaller than "52", they end up doing some kind of webcompat (?) work-around which uses divs instead of buttons, but breaks on more recent Firefox versions:

    var h = i.a.forwardRef(((e, t) =>{
      let {
        onClick: n,
        className: o
      }
      = e,
      c = Object(s.a) (e, [
        'onClick',
        'className'
      ]);
      const l = Object(r.useCallback) ((e=>{
        ' ' !== e.key && 'Enter' !== e.key || n && n(e)
      }), [
        n
      ]);
      return i.a.createElement('div', Object(a.a) ({
      }, c, {
        className: d() ('c-flex_compat_button', o),
        role: 'button',
        tabIndex: 0,
        ref: t,
        onKeyPress: l
      }))
    })),

I confirmed this by trying with "51" as the version (upon which I can't click the UI elements even on their "browser is out of date" warning popup), but "52" doesn't exhibit the problem.

This appears to just be a coding oversight, as they are using number comparisons elsewhere rather than strings.

@karlcow karlcow modified the milestones: needsdiagnosis, contactready Mar 11, 2021
@karlcow
Copy link
Member

karlcow commented Mar 11, 2021

then let switch to contact ready.

@wisniewskit wisniewskit self-assigned this Mar 11, 2021
@webcompat-bot
Copy link

@Plambey
Copy link

Plambey commented Mar 18, 2021

Hey folks, very helpful for flagging this! Just letting you know that we've raised this internally at Slack to dive in, thanks for the deep dive above highlighting the issue in the .js script.

Patrick - Slack CE

@Plambey
Copy link

Plambey commented Apr 1, 2021

Hi there,

Just following up to let you know we believe we've addressed this issue, and can no longer repro the issue with the below:

• visit about:config
• search for general.useragent.override
• change it to: Mozilla/5.0 (Windows NT 10.0; rv:100.0) Gecko/20100101 Firefox/100.0
• reload Slack
• try to interact with any emoji/menu buttons
• see that they don't work.

From our end, the buttons appear to be working again as expected.

Thanks again for bringing this to our attention,

Patrick - Slack CE.

@cpeterso
Copy link
Author

cpeterso commented Apr 1, 2021

Thanks, @Plambey! I just tested with a "Firefox 100" User-Agent string and Slack reactions now work for me. 👍🏻

@karlcow karlcow modified the milestones: contactready, fixed Apr 26, 2021
@denschub denschub added the version100 label for browser with version 100 in their UA string label Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser-firefox engine-gecko The browser uses the Gecko rendering engine priority-important priority-normal severity-important A non-core broken piece of functionality, not behaving the way you would expect. type-ua-3digits version100 label for browser with version 100 in their UA string
Projects
None yet
Development

No branches or pull requests

7 participants