New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 864426 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Jul 18
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Polymer renders int64 integer type to a random number

Project Member Reported by liaoyuke@chromium.org, Jul 17

Issue description

build is a int64 type, and when used as variables in html template rendering, it is always rendered to another random number. For example, 8940798377940317952 -> 8941290266081829792, and this is causing all the build links to point to 404 on Findit flake detection page.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/826cd8e457c8d68eeea6c078126a220b5279cb1c

commit 826cd8e457c8d68eeea6c078126a220b5279cb1c
Author: Yuke Liao <liaoyuke@chromium.org>
Date: Tue Jul 17 14:27:16 2018

[Findit] Convert build id from type int64 to string.

Polymer renders int64 type to a random number in html template variable
replacement, and this is causing all the link on flake detection
frontend page to point to 404, so convert int64 to str to work this
around.

Following version verifies this fixes the build links:
https://16565-e9b28f5-tainted-liaoyuke-dot-findit-for-me-staging.appspot.com/flake/detection/show-flake?key=ahdzfmZpbmRpdC1mb3ItbWUtc3RhZ2luZ3JTCxIFRmxha2UiSGNocm9taXVtQGludGVyYWN0aXZlX3VpX3Rlc3RzQEF1dG9maWxsSW50ZXJhY3RpdmVUZXN0Lk1vZGlmeUZpZWxkQW5kRmlsbAw

Bug:  864426 ,  845581 
Change-Id: I36ef1075e0642a1e77b61b0babe17548e7641f21
Reviewed-on: https://chromium-review.googlesource.com/1140101
Reviewed-by: Shuotao Gao <stgao@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>

[modify] https://crrev.com/826cd8e457c8d68eeea6c078126a220b5279cb1c/appengine/findit/handlers/flake/detection/show_flake.py
[modify] https://crrev.com/826cd8e457c8d68eeea6c078126a220b5279cb1c/appengine/findit/handlers/flake/detection/test/show_flake_test.py

Status: WontFix (was: Assigned)
I think the reason is that: https://www.w3schools.com/js/js_numbers.asp:

JavaScript Numbers are Always 64-bit Floating Point
Unlike many other programming languages, JavaScript does not define different types of numbers, like integers, short, long, floating-point etc.

JavaScript numbers are always stored as double precision floating point numbers, following the international IEEE 754 standard. 

This format stores numbers in 64 bits, where the number (the fraction) is stored in bits 0 to 51, the exponent in bits 52 to 62, and the sign in bit 63:

Precision
Integers (numbers without a period or exponent notation) are accurate up to 15 digits.

That explains why large int64 numbers are converted to something random.
Project Member

Comment 3 by bugdroid1@chromium.org, Jul 31

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra/+/840575c3772d16beff13531c090ce98429dd4642

commit 840575c3772d16beff13531c090ce98429dd4642
Author: Yuke Liao <liaoyuke@chromium.org>
Date: Tue Jul 31 01:31:04 2018

[Findit] Update comments of converting type if build ids.

This CL updates the comments of converting the type of build ids before
rendering HTML pages to reflect the true reasons.

Bug:  864426 
Change-Id: I13756ccc2c9fd6577b477708876eb45051b8dc86
Reviewed-on: https://chromium-review.googlesource.com/1141544
Reviewed-by: Chan Li <chanli@chromium.org>
Commit-Queue: Yuke Liao <liaoyuke@chromium.org>

[modify] https://crrev.com/840575c3772d16beff13531c090ce98429dd4642/appengine/findit/handlers/flake/detection/show_flake.py
[modify] https://crrev.com/840575c3772d16beff13531c090ce98429dd4642/appengine/findit/handlers/flake/detection/test/show_flake_test.py

Sign in to add a comment