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

[Bug]: Resolving "Edge < 117" outputs a regexp that matches Edge/120.0.0 #1530

Closed
1 task
jrmlt opened this issue Dec 12, 2023 · 0 comments · Fixed by #1533
Closed
1 task

[Bug]: Resolving "Edge < 117" outputs a regexp that matches Edge/120.0.0 #1530

jrmlt opened this issue Dec 12, 2023 · 0 comments · Fixed by #1533
Assignees
Labels
bug Something isn't working

Comments

@jrmlt
Copy link

jrmlt commented Dec 12, 2023

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Current and expected behavior

Current

Output regexp for Edge < 117 matches Edge/120.0.0 user agent.

node ./dist/cli.js Edge < 117 --verbose

> Browserslist

edge  12.0.0  13.0.0  14.0.0  15.0.0  16.0.0  17.0.0  18.0.0  79.0.0  80.0.0  81.0.0  83.0.0  84.0.0  85.0.0  86.0.0  87.0.0  88.0.0  89.0.0  90.0.0  91.0.0  92.0.0  93.0.0  94.0.0  95.0.0  96.0.0  97.0.0  98.0.0  99.0.0  100.0.0  101.0.0  102.0.0  103.0.0  104.0.0  105.0.0  106.0.0  107.0.0  108.0.0  109.0.0  110.0.0  111.0.0  112.0.0  113.0.0  114.0.0  115.0.0  116.0.0

> Regexes

Family:                          edge                                                                                                                                                                                                                                                                                                                                
Versions:                        12.0.0 13.0.0 14.0.0 15.0.0 16.0.0 17.0.0 18.0.0 79.0.0 80.0.0 81.0.0 83.0.0 84.0.0 85.0.0 86.0.0 87.0.0 88.0.0 89.0.0 90.0.0 91.0.0 92.0.0 93.0.0 94.0.0 95.0.0 96.0.0 97.0.0 98.0.0 99.0.0 100.0.0 101.0.0 102.0.0 103.0.0 104.0.0 105.0.0 106.0.0 107.0.0 108.0.0 109.0.0 110.0.0 111.0.0 112.0.0 113.0.0 114.0.0 115.0.0 116.0.0
Matched versions:                12.0.0 13.0.0 14.0.0 15.0.0 16.0.0 17.0.0 18.0.0 79.0.0 80.0.0 81.0.0 83.0.0 84.0.0 85.0.0 86.0.0 87.0.0 88.0.0 89.0.0 90.0.0 91.0.0 92.0.0 93.0.0 94.0.0 95.0.0 96.0.0 97.0.0 98.0.0 99.0.0 100.0.0 101.0.0 102.0.0 103.0.0 104.0.0 105.0.0 106.0.0 107.0.0 108.0.0 109.0.0 110.0.0 111.0.0 112.0.0 113.0.0 114.0.0 115.0.0 116.0.0
Source regex:                    /Edge?\/(\d+)(\.(\d+)|)(\.(\d+)|)/                                                                                                                                                                                                                                                                                                  
Source regex browsers versions:  ... - ...                                                                                                                                                                                                                                                                                                                           
Versioned regex:                 /Edge?\/(1[2-8](\.0|)|(79|8[01])(\.0|)|(8[3-9]|9\d|1(0\d|1[0-6]))(\.0|))(\.\d+|)/                                                                                                                                                                                                                                                   


/Edge?\/(1[2-8](\.0|)|(79|8[01])(\.0|)|(8[3-9]|9\d|1(0\d|1[0-6]))(\.0|))(\.\d+|)/

Expected

Output regexp to not match Edge/120.0.0

Reproduction

NA

browserslist-useragent-regexp version

v4.1.0

Possible solution

Possible problem is that the source regexp from ua-regexes-lite specify the minor version as optional /Edge?\/(\d+)(\.(\d+)|)(\.(\d+)|)/. Not sure if this is necessary here as EdgeHTML before Chromium seems to always specify the windows build. Removing this optional statement would fix the issue.
Otherwise a fix on how browserslist-useragent-regexp compiles this source regexp with Edge versions is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants