[Maps][File upload] Remove geojson deep clone logic, handle on maps side#41835
Conversation
x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js
Outdated
Show resolved
Hide resolved
💚 Build Succeeded |
x-pack/legacy/plugins/maps/public/layers/sources/client_file_source/geojson_file_source.js
Outdated
Show resolved
Hide resolved
💚 Build Succeeded |
|
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. |
💚 Build Succeeded |
thomasneirynck
left a comment
There was a problem hiding this comment.
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', () => { |
There was a problem hiding this comment.
I would just preserve the test but flip the expectation. We're not expecting a clone, rather an identical reference.
There was a problem hiding this comment.
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?"
There was a problem hiding this comment.
Might prevent them from introducing deepclone for some unrelated reason, without checking why this LOC was changed (?) anyway, your call!
…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
…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
…-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) ...
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).