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

fix(core): can not get chrome version in desktop mode in iOS #7791

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

L-Sun
Copy link
Contributor

@L-Sun L-Sun commented Aug 8, 2024

When set iOS chrome to desktop mode, the ua will be like:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/127 Version/11.1.1 Safari/605.1.15

The CriOS/127 can not be tested by the following code, which make app crash

getChromeVersion = (): number => {
const raw = this.navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
assertExists(raw);
return parseInt(raw[2], 10);
};

Copy link

graphite-app bot commented Aug 8, 2024

Your org has enabled the Graphite merge queue for merging into canary

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Contributor Author

L-Sun commented Aug 8, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @L-Sun and the rest of your teammates on Graphite Graphite

Copy link

nx-cloud bot commented Aug 8, 2024

@L-Sun L-Sun marked this pull request as ready for review August 8, 2024 09:50
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 55.53%. Comparing base (7fca130) to head (509ded0).

Files Patch % Lines
packages/common/env/src/ua-helper.ts 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           canary    #7791      +/-   ##
==========================================
- Coverage   55.58%   55.53%   -0.05%     
==========================================
  Files        1003     1003              
  Lines       43397    43401       +4     
  Branches     5147     5148       +1     
==========================================
- Hits        24122    24103      -19     
- Misses      18911    18934      +23     
  Partials      364      364              
Flag Coverage Δ
server-test 78.76% <ø> (-0.08%) ⬇️
unittest 26.75% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

graphite-app bot commented Aug 8, 2024

Merge activity

  • Aug 8, 6:03 AM EDT: The merge label 'merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 8, 6:03 AM EDT: The merge label 'merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Aug 8, 6:08 AM EDT: L-Sun added this pull request to the Graphite merge queue.
  • Aug 8, 6:21 AM EDT: The Graphite merge queue couldn't merge this PR because it was not satisfying all requirements (Failed CI: '3, 2, 1 Launch', 'Desktop Test (windows-latest, windows, x64, x86_64-pc-windows-msvc, true)').
  • Aug 8, 6:36 AM EDT: EYHN added this pull request to the Graphite merge queue.

When set iOS chrome to desktop mode, the ua will be like:
```
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/127 Version/11.1.1 Safari/605.1.15
```

The `CriOS/127` can not be tested by the following code, which make app crash

https://github.com/toeverything/AFFiNE/blob/fd6e19829550d983cb4a3640f05a8dd8f50c92b6/packages/common/env/src/ua-helper.ts#L14-L18
@graphite-app graphite-app bot removed the merge label Aug 8, 2024
@EYHN EYHN merged commit 3d4fbca into canary Aug 8, 2024
34 checks passed
@EYHN EYHN deleted the l-sun/fix/chrome-ios-ua branch August 8, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants