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

[Maps] prevent users from overflowing URL when filtering by shape #50747

Merged
merged 8 commits into from Nov 18, 2019

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Nov 15, 2019

fixes #50173 and #50652.

related to #45521

Creating a filter by shape can overflow the URL since the filter goes into app state which is part of the URL.

Once a filter that overflows the URL, #50173 was exposed. There is a bug in angular_config method $setupUrlOverflowHandling at https://github.com/elastic/kibana/blob/master/src/legacy/ui/public/legacy_compat/angular_config.tsx#L356. modifyUrl does not exist. PR #38237 removed src/core/public/utils/modify_url.ts which was duplicated in src/core/utils/url.ts but failed to update the path referenced by ui/url/index.js. Since the path referenced by ui/url/index.js still hit an index.js file, no build exception occurred.

This PR prevents users from overflowing the URL by not allowing them to create filters that are super long. Not the best solution but better then the havoc found in issue #50652.

This is pretty limiting since pre-indexed shapes can not be used to query geo_point indices yet, but given the problems URL overflows are causing, this PR is better than the alternative.

To test, create a filter from the United States EMS boundary that can be found in the ecommerce sample data or web logs sample data.

Screen Shot 2019-11-14 at 8 16 43 PM

cc @bhavyarm you will need to remove the session state error/url-overflow/url to clean up your browser before everything will work correctly.

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@nreese
Copy link
Contributor Author

nreese commented Nov 15, 2019

@gchaps added you as a review for the error message displayed when the filter can not be created.

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@nreese
Copy link
Contributor Author

nreese commented Nov 15, 2019

retest

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

Cannot create filter. The shape has too many vertices.

@nreese
Copy link
Contributor Author

nreese commented Nov 18, 2019

Cannot create filter. The shape has too many vertices.

@gchaps The more I think about this message, I think it needs to mention the real limitation which is overflowing the URL. How about something like

"Cannot create filter because filter will overflow URL."

@gchaps
Copy link
Contributor

gchaps commented Nov 18, 2019

@nreese I'm not sure what you mean by "overflow the URL means". Can you be more specific?

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese
Copy link
Contributor Author

nreese commented Nov 18, 2019

Chatted with @gchaps and came up with

"Cannot create filter. Filters are added to the URL, and this shape has too many vertices to fit in the URL."

Copy link
Contributor

@gchaps gchaps left a comment

Choose a reason for hiding this comment

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

Tooltip content LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@nreese nreese merged commit 37d82db into elastic:master Nov 18, 2019
nreese added a commit to nreese/kibana that referenced this pull request Nov 18, 2019
…astic#50747)

* [Maps] prevent users from overflowing URL when filtering by shape

* small fix

* fix jest test

* update warning message

* update overflow error message
nreese added a commit to nreese/kibana that referenced this pull request Nov 18, 2019
…astic#50747)

* [Maps] prevent users from overflowing URL when filtering by shape

* small fix

* fix jest test

* update warning message

* update overflow error message
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

nreese added a commit that referenced this pull request Nov 18, 2019
…0747) (#50958)

* [Maps] prevent users from overflowing URL when filtering by shape

* small fix

* fix jest test

* update warning message

* update overflow error message
nreese added a commit that referenced this pull request Nov 18, 2019
…0747) (#50957)

* [Maps] prevent users from overflowing URL when filtering by shape

* small fix

* fix jest test

* update warning message

* update overflow error message
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 18, 2019
…-fallback

* 'master' of github.com:elastic/kibana: (116 commits)
  [Maps] move apply global filter settting from layer to source (elastic#50523)
  [SIEM] Fix: Empty `Source` / `Destination` shown when only ports are populated (elastic#50843)
  [Maps] Delay vector tile layer syncing until spritesheet is loaded (elastic#48955)
  [Maps] prevent users from overflowing URL when filtering by shape (elastic#50747)
  [DOCS] Mark Beats central management as discontinued (elastic#49423)
  [page_objects/common_page] convert to ts (elastic#50771)
  [NP Kibana Migrations ] kibana plugin home (elastic#50444)
  [DOCS] Shareables naming convention (elastic#50497)
  [ML] DF Analytics - auto-populate model_memory_limit (elastic#50714)
  Increase alerting test stability and reduce flakiness (elastic#50246)
  [ML] Remaning new_job_new folder (elastic#50917)
  [Telemetry] Show opt-in changes for OSS users (elastic#50831)
  [ML] Fix lat_long anomalies table links menu and value formatting (elastic#50916)
  [Dev] Fix serialising a really big string (elastic#50915)
  Better explanation about the Prettier recommendation (extension vs. NPM module) (elastic#50629)
  [Monitoring] Use a basic monitoring user for tests (elastic#47865)
  [Monitoring] Gracefully handle issue with filebeat indices (elastic#48929)
  [Monitoring] Improve permissions required around setup mode (elastic#50421)
  Additional validation for elasticsearch username (elastic#48247)
  Revert changes to use_kibana_ui_setting (elastic#50877)
  ...

# Conflicts:
#	src/legacy/core_plugins/console/server/request.test.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants