Skip to content

[Maps][File upload] Remove geojson deep clone logic, handle on maps side#41835

Merged
kindsun merged 6 commits intoelastic:masterfrom
kindsun:optimize-parsed-geojson-copy-step
Jul 30, 2019
Merged

[Maps][File upload] Remove geojson deep clone logic, handle on maps side#41835
kindsun merged 6 commits intoelastic:masterfrom
kindsun:optimize-parsed-geojson-copy-step

Conversation

@kindsun
Copy link
Contributor

@kindsun kindsun commented Jul 23, 2019

Previously we were cloning the entire geojson object on the File Upload side to prevent downstream modification of features prior to indexing. This PR removes the cloning logic and instead copies just the parts we need on the maps side (i.e.- type & geometry per feature).

@kindsun kindsun added Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.4.0 Feature:File Upload v7.3.1 labels Jul 23, 2019
@kindsun kindsun requested a review from thomasneirynck July 23, 2019 22:06
Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

Thanks!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@thomasneirynck thomasneirynck self-requested a review July 26, 2019 20:16
@thomasneirynck thomasneirynck added bug Fixes for quality problems that affect the customer experience and removed release_note:skip Skip the PR/issue when compiling release notes labels Jul 26, 2019
@thomasneirynck
Copy link
Contributor

thomasneirynck commented Jul 26, 2019

Should not skip release note, but add one to the effect of "Geojson upload is now more stable to upload large geometries", or something along those lines. E.g. the army bases file (small feature count, but huge geometries) now uploads fairly fast, while without this upload often hanged or the browser tab crashed.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@thomasneirynck thomasneirynck left a comment

Choose a reason for hiding this comment

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

This is killer improvement for large files with low number of features. Try uploading army base before and after and notice the difference.

expect(previewFunction.mock.calls.length).toEqual(1);
});

it('should use object clone for preview function', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just preserve the test but flip the expectation. We're not expecting a clone, rather an identical reference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure it helps us anymore. The preview function is really now just a normal function call with normal args. If I were a developer looking at this code later and I saw a test checking to make sure one arg isn't a clone but rather the same object, I'd wonder "well, why would it be a clone?"

Copy link
Contributor

Choose a reason for hiding this comment

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

Might prevent them from introducing deepclone for some unrelated reason, without checking why this LOC was changed (?) anyway, your call!

@kindsun kindsun merged commit 09ae6e3 into elastic:master Jul 30, 2019
kindsun pushed a commit to kindsun/kibana that referenced this pull request Jul 30, 2019
…ide (elastic#41835)

* Remove deep clone, just use type & geometry for features on maps end

* Remove file parser clone test

* Review feedback

* Set properties default to empty object since there's downstream modification

* Review feedback
kindsun pushed a commit to kindsun/kibana that referenced this pull request Jul 30, 2019
…ide (elastic#41835)

* Remove deep clone, just use type & geometry for features on maps end

* Remove file parser clone test

* Review feedback

* Set properties default to empty object since there's downstream modification

* Review feedback
jloleysens added a commit to jloleysens/kibana that referenced this pull request Jul 31, 2019
…-or-edit-existing-rollup-job

* 'master' of github.com:elastic/kibana: (114 commits)
  [ML] Fixing empty index pattern list (elastic#42299)
  [Markdown] Shim new platform - cleanup plugin (elastic#41760)
  [Code] Enable hierarchicalDocumentSymbolSupport for java language server (elastic#42233)
  Add New Platform mocks for data plugin (elastic#42261)
  Http server route handler implementation (elastic#41894)
  [SR] Allow custom index pattern to be used instead of selectable list when choosing indices to restore (elastic#41534)
  [Code] distributed Code abstraction (elastic#41374)
  [SIEM] Sets page titles to the current page you are on  (elastic#42157)
  Saved Objects export API stable type order (elastic#42310)
  cancellation of interpreter execution (elastic#40238)
  [SIEM] Fixes a crash when Machine Learning influencers is an undefined value (elastic#42198)
  Changed the job to work with a dedicated index (elastic#42297)
  FTR: fix testSubjects.missingOrFail (elastic#42290)
  Increase retry timeout to prevent flaky tests (elastic#42291)
  Spaces - make space a hidden saved object type (elastic#41688)
  Allow applications to register feature privileges which are excluded from the base privileges (elastic#41300)
  Disable flaky log column reorder test (elastic#42285)
  Fixing add element in element reducer (elastic#42276)
  Fix infinite loop (elastic#42228)
  [Maps][File upload] Remove geojson deep clone logic, handle on maps side (elastic#41835)
  ...
kindsun pushed a commit that referenced this pull request Jul 31, 2019
…ide (#41835) (#42294)

* Remove deep clone, just use type & geometry for features on maps end

* Remove file parser clone test

* Review feedback

* Set properties default to empty object since there's downstream modification

* Review feedback
kindsun pushed a commit that referenced this pull request Jul 31, 2019
…ide (#41835) (#42292)

* Remove deep clone, just use type & geometry for features on maps end

* Remove file parser clone test

* Review feedback

* Set properties default to empty object since there's downstream modification

* Review feedback
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:File Upload release_note:fix Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v7.3.1 v7.4.0 v8.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants