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

Auto-indent rounds large numbers #101391

Open
EmilBode opened this issue Jun 4, 2021 · 8 comments
Open

Auto-indent rounds large numbers #101391

EmilBode opened this issue Jun 4, 2021 · 8 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Console Dev Tools Console Feature Feature:Dev Tools Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more

Comments

@EmilBode
Copy link

EmilBode commented Jun 4, 2021

Kibana version: 7.13.1 (newest), also observed on 7.12.0

Elasticsearch version: 7.13.1, or 7.12.0

Server OS version: Windows 10 (64-bit)

Browser version: Chrome (64-bit, newest)

Browser OS version: Windoes 10 (64-bit)

Original install method (e.g. download page, yum, from source, etc.): Download (from https://www.elastic.co/downloads/kibana)

Describe the bug:

Steps to reproduce:

  1. Go to console
  2. Write some query, including a large number
  3. Hit Ctrl+I, or hover over the wrench and click "Auto indent"

Expected behavior:
I'd expect allignment, newlines and indentation to be fixed/modified, but my query to be otherwise identical

Actual baheviour
Indentation is modified, but large numbers are also rounded. This leads to different results.

Example:
When using pagination, the search_after parameter needs to be exactly copied. The query I originally wanted to execute:

GET /_search
{
  "pit": {
    "id": "15izAwEEdGVzdBZkOHNKLTlvV1JYbU9MWE5aaHRCQTVnABZHZFlxQXNXcFNmU0xFUm9kR3hpR1JBAAAAAAAAABeSFkluaW8yNEVBUkFHVXlZWlNfb2dRNHcAARZkOHNKLTlvV1JYbU9MWE5aaHRCQTVnAAA="
  },
  "query": {
    "match_all": {}
  },
  "size": 1,
  "sort": {
    "timestamp": {
      "order": "desc"
    }
  },
  "search_after": [
          -9223372036854775808,
          1
        ]
}

was modified to this:

GET /_search
{
  "pit": {
    "id": "15izAwEEdGVzdBZkOHNKLTlvV1JYbU9MWE5aaHRCQTVnABZHZFlxQXNXcFNmU0xFUm9kR3hpR1JBAAAAAAAAABeSFkluaW8yNEVBUkFHVXlZWlNfb2dRNHcAARZkOHNKLTlvV1JYbU9MWE5aaHRCQTVnAAA="
  },
  "query": {
    "match_all": {}
  },
  "size": 1,
  "sort": {
    "timestamp": {
      "order": "desc"
    }
  },
  "search_after": [
    -9223372036854776000,
    1
  ]
}

The two seem very alike. Yet the first one ran as expected, while the second one gave me an error, due to the now rounded number causing an overflow.

See also elastic/elasticsearch#73772, where I originally suspected something competely different

@EmilBode EmilBode added the bug Fixes for quality problems that affect the customer experience label Jun 4, 2021
@botelastic botelastic bot added the needs-team Issues missing a team label label Jun 4, 2021
@TinaHeiligers TinaHeiligers added the Feature:Console Dev Tools Console Feature label Jun 4, 2021
@TinaHeiligers
Copy link
Contributor

@elastic/es-ui Is console still in your domain as per CODEOWNERS?

@tsullivan
Copy link
Member

cc @elastic/elastic-ui it looks like we don't have a team: label for you yet

@cjcenizal cjcenizal added Feature:Dev Tools Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more and removed needs-team Issues missing a team label labels Jun 9, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-stack-management (Team:Stack Management)

@cjcenizal
Copy link
Contributor

cjcenizal commented Jun 9, 2021

@TinaHeiligers @tsullivan ES UI is now @elastic/kibana-stack-management 😄

And yes, we still maintain all Dev Tools including Console.

I'm pretty sure @elastic/elastic-ui is the original alias for the Kibana team from back in the day.

@andrew-moldovan
Copy link

Pings every ui engineer in the company... 😂

@pgayvallet
Copy link
Contributor

pgayvallet commented Jun 9, 2021

but large numbers are also rounded. This leads to different results.

>> Number.isSafeInteger(-9223372036854775808)
false
>> -9223372036854775808 === -9223372036854776000
true

This is probably caused by the fact that the reindent script is parsing the JSON to perform the reindent, resulting on non-safe integer being truncated.

Related to #40183

Note that console was not supposed to be impacted by the bigint JS limitations, as the input text is send as-is to ES, however, I guess any code transformation we're performing during the reindex is effectively impacted by these problems.

Edited #40183 to reflect that.

@alisonelizabeth
Copy link
Contributor

Note that this issue appears to occur now regardless if "auto indent" is used

@yuliacech yuliacech self-assigned this Aug 15, 2024
@yuliacech yuliacech removed their assignment Sep 13, 2024
@alisonelizabeth alisonelizabeth removed the Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more label Sep 17, 2024
@botelastic botelastic bot added the needs-team Issues missing a team label label Sep 17, 2024
@alisonelizabeth alisonelizabeth added the Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more label Sep 17, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Console Dev Tools Console Feature Feature:Dev Tools Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Projects
None yet
Development

No branches or pull requests

9 participants