Skip to content

fix: Request Desktop Site feature with only MajorVersion - #14322

Merged
taefi merged 2 commits into
masterfrom
issues/13921_singeVersionChrome
Aug 11, 2022
Merged

taefi merged 2 commits into
masterfrom
issues/13921_singeVersionChrome

Conversation

@caalador

Copy link
Copy Markdown
Contributor

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921
@github-actions

github-actions Bot commented Aug 11, 2022 •

Copy link
Copy Markdown
Contributor

Unit Test Results

   917 files  ±0     917 suites  ±0   56m 14s ⏱️ + 5m 28s
6 009 tests +1  5 956 ✔️ +2  53 💤 ±0  0 ❌ ±0 
6 231 runs  +7  6 171 ✔️ +8  60 💤 ±0  0 ❌ ±0 

Results for commit c99e558. ± Comparison against base commit ae8e454.

♻️ This comment has been updated with latest results.

Comment on lines +317 to +320
private static int getVersionStringLength(String userAgent, int i) {
int versionBreak = userAgent.substring(i).indexOf(" ");
if (versionBreak == -1) {
versionBreak = userAgent.substring(i).length();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static int getVersionStringLength(String userAgent, int i) {
int versionBreak = userAgent.substring(i).indexOf(" ");
if (versionBreak == -1) {
versionBreak = userAgent.substring(i).length();
private static int getVersionStringLength(String userAgent, int versionIdx) {
int versionBreak = userAgent.substring(versionIdx).indexOf(" ");
if (versionBreak == -1) {
versionBreak = userAgent.substring(versionIdx).length();

int versionBreak = getVersionStringLength(userAgent, i);
parseVersionString(safeSubstring(userAgent, i, i + versionBreak));
} else {
i += 7;

@taefi taefi Aug 11, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although it is not part of the changes here, just asking out of curiosity, is this i += 7; happens due to the " crios/".length()?
If so, as an additional improvement, I suggest defining a constant or a final local variable for " crios/" and using its length instead of the literal value of 7.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed one more magic number.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 11 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@taefi
taefi enabled auto-merge (squash) August 11, 2022 12:06
@taefi
taefi merged commit 7345836 into master Aug 11, 2022
@taefi
taefi deleted the issues/13921_singeVersionChrome branch August 11, 2022 12:10
vaadin-bot pushed a commit that referenced this pull request Aug 11, 2022
* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921
vaadin-bot pushed a commit that referenced this pull request Aug 11, 2022
* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921
vaadin-bot pushed a commit that referenced this pull request Aug 11, 2022
* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921
vaadin-bot pushed a commit that referenced this pull request Aug 11, 2022
* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921
vaadin-bot pushed a commit that referenced this pull request Aug 11, 2022
* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921
vaadin-bot pushed a commit that referenced this pull request Aug 11, 2022
* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921
vaadin-bot pushed a commit that referenced this pull request Aug 11, 2022
* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921
vaadin-bot pushed a commit that referenced this pull request Aug 11, 2022
* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921
taefi pushed a commit that referenced this pull request Aug 11, 2022
…4330)

* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921

Co-authored-by: caalador <mikael.grankvist@vaadin.com>
taefi pushed a commit that referenced this pull request Aug 11, 2022
…4329)

* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921

Co-authored-by: caalador <mikael.grankvist@vaadin.com>
taefi pushed a commit that referenced this pull request Aug 11, 2022
…4328)

* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921

Co-authored-by: caalador <mikael.grankvist@vaadin.com>
taefi pushed a commit that referenced this pull request Aug 11, 2022
…4327)

* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921

Co-authored-by: caalador <mikael.grankvist@vaadin.com>
taefi pushed a commit that referenced this pull request Aug 11, 2022
…4326)

* fix: Request Desktop Site feature with only MajorVersion

Fixes User Agent in Chrome for iOS when the
Request Desktop Site feature is enabled.
At this time the version only consists of the major version.

part of #13921

Co-authored-by: caalador <mikael.grankvist@vaadin.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 23.2.0.beta1 and is also targeting the upcoming stable 23.2.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants