Incorrect Chrome version in iSL user agent |
|||||||||
Issue descriptionSteps to reproduce the problem: 1. Sign in to chromesync in iOS 2. Find the reported user agent 3. What is the expected behavior? User agent should be with the actual version e.g. "62.0.3202.70". What went wrong? User agent missing minor version number: "62.3202.70". This issue exists for all chrome versions. Did this work before? N/A Chrome version: 62.0.3202.70 Channel: stable OS Version: 11.1.1 Flash Version:
,
Apr 5 2018
,
Apr 5 2018
Eugene, how are we getting the version number reported in our UA?
,
Apr 5 2018
The following string is an actual Chrome User Agent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.3 Mobile/15E216 Safari/604.1" I used Chrome 67.0.3387.0 and extracted user agent by googling "my user agent". Sofia, how did you find User Agent which contains specific Chrome version?
,
Apr 6 2018
I tried on stable, I have the minor version on my user agent. My user agent is of the form: https://developer.chrome.com/multidevice/user-agent#chrome_for_ios_user_agent Is the behavior where the minor version is omitted only happening with some conditions?
,
Apr 6 2018
Seems like we have different User Agents in dev and stable channels. Here is the place where version number is coming from: https://cs.chromium.org/chromium/src/ios/chrome/browser/web/chrome_web_client.mm?type=cs&q=ChromeWebClient::GetProduct&sq=package:chromium&l=107 version_info::GetVersionNumber() simply uses PRODUCT_VERSION define, which is probably coming from GN. Sylvain, would you ming taking a look why PRODUCT_VERSION does not have minor version number.
,
Apr 6 2018
AFAIK, the version string returned by version_info::GetVersionNumber() is always the same on all channels. It is generated at build time from values coming from //chrome/VERSION (updated on master when a branch is cut and on release branches every time a build is started) and some other sources (but they don't contribute to the version, just to LASTCHANGE and the product name). This generate a header file using the template components/version_info/version_info_values.h.version that is the same on all channels. In fact, when building Chrome on iOS, all channels have exactly the same binary, the only change is the value of the KSChannel key in the application Info.plist (well, and the entitlements, identity used to sign, ...). There is another version number in the application Info.plist. This one is generated from the same values (//chrome/VERSION) using build/mac/tweak_info_plist.py script. This script drops the MINOR when building the Info.plist for an iOS application as Apple store require the version number stored in the Info.plist to use a.b.c format (this is stored as CFBundleShortVersionString, the full version is still stored as CFBundleVersionString). The version from the bundle Info.plist is read in base/file_version_info_mac.mm, in the implementation of the FileVersionInfoMac class which is the concrete implementation of the abstract class FileVersionInfo shared on macOS and iOS. Querying the version from FileVersionInfo will thus return a version matching MAJOR.BUILD.PATCH while querying the version from version_info::GetVersionNumber() will return a version matching MAJOR.MINOR.BUILD.PATCH. There may be other location reading the version from the app bundle Info.plist. TL;DR: if the code use MAJOR.BUILD.PATCH then it means that it gets its version from the app bundle Info.plist. It is very suspicious if the version is different between channels (since they are the same binary).
,
Apr 6 2018
Version is not different between channels. It's just that dev channel did not have CriOS/<version> part at all. Sylvain, do you think this is WAI, or VERSION macro value should not be populated with Info.plist version?
,
Apr 6 2018
AFAICT, currently, PRODUCT_VERSION is not populated from Info.plist.
,
Apr 13 2018
,
Apr 13 2018
I don't think I'm the right person to fix GN generation bugs. Sylvain, do you know if anyone on Chrome team knows how PRODUCT_VERSION is generated for iOS? Would you be the right person to fix this bug?
,
Apr 16 2018
Leaving this as Available.
,
May 25 2018
|
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by kkhorimoto@chromium.org
, Apr 5 2018