From d7a5be45f5dff1b0e8d56a1543969a6fe48a25eb Mon Sep 17 00:00:00 2001 From: "elastic-renovate-prod[bot]" <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> Date: Mon, 8 Sep 2025 20:42:48 +0000 Subject: [PATCH 1/2] Update dependency rison-node to v2 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 68f1826a3188d..5c80c8061a699 100644 --- a/package.json +++ b/package.json @@ -1377,7 +1377,7 @@ "remark-stringify": "^8.0.3", "require-in-the-middle": "^7.5.2", "reselect": "^4.1.8", - "rison-node": "1.0.2", + "rison-node": "2.1.1", "rxjs": "^7.8.2", "safe-squel": "^5.12.5", "seedrandom": "^3.0.5", diff --git a/yarn.lock b/yarn.lock index 136007ad5cd55..d5dbb690264a7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -29332,10 +29332,10 @@ ripemd160@=2.0.1, ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^2.0.0" inherits "^2.0.1" -rison-node@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/rison-node/-/rison-node-1.0.2.tgz#b7b5f37f39f5ae2a51a973a33c9aa17239a33e4b" - integrity sha1-t7Xzfzn1ripRqXOjPJqhcjmjPks= +rison-node@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/rison-node/-/rison-node-2.1.1.tgz#3db68c6a736442a5494826f86fc8d675933934a5" + integrity sha512-GuV0OnSL2erZJ0j/9YUsrAdfSh3mGcrq+4wM4PqRftOYT7+TRhxbMrpVZaGC5YIPwncIoOM7PPnskDku5Ywg1Q== robots-parser@^3.0.1: version "3.0.1" From 9a815fca6a18eb73302c72f32427de509fccc399 Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Thu, 11 Sep 2025 12:25:59 -0700 Subject: [PATCH 2/2] update jest test as rison numeric keys are no longer quoted --- .../es_search_source/es_search_source.test.ts | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/x-pack/platform/plugins/shared/maps/public/classes/sources/es_search_source/es_search_source.test.ts b/x-pack/platform/plugins/shared/maps/public/classes/sources/es_search_source/es_search_source.test.ts index 41ec850755fb2..eb92ef79ad396 100644 --- a/x-pack/platform/plugins/shared/maps/public/classes/sources/es_search_source/es_search_source.test.ts +++ b/x-pack/platform/plugins/shared/maps/public/classes/sources/es_search_source/es_search_source.test.ts @@ -10,13 +10,14 @@ import { APP_ID, ES_GEO_FIELD_TYPE, SCALING_TYPES } from '../../../../common/con jest.mock('../../../kibana_services'); jest.mock('./util/load_index_settings'); -import { getIndexPatternService, getSearchService, getHttp } from '../../../kibana_services'; import type { SearchSource } from '@kbn/data-plugin/public'; +import { decode } from '@kbn/rison'; +import { getHttp, getIndexPatternService, getSearchService } from '../../../kibana_services'; import { loadIndexSettings } from './util/load_index_settings'; -import { ESSearchSource } from './es_search_source'; import type { VectorSourceRequestMeta } from '../../../../common/descriptor_types'; +import { ESSearchSource } from './es_search_source'; const mockDescriptor = { indexPatternId: 'foo', geoField: 'bar' }; @@ -132,15 +133,33 @@ describe('ESSearchSource', () => { expect(urlParts[0]).toEqual('rootdir/internal/maps/mvt/getTile/{z}/{x}/{y}.pbf'); const params = new URLSearchParams(urlParts[1]); - expect(Object.fromEntries(params)).toEqual({ + + expect(Object.fromEntries(params)).toMatchObject({ buffer: '5', geometryFieldName: 'bar', hasLabels: 'false', index: 'foobar-title-*', - requestBody: - "(fields:('0':('0':index,'1':(fields:(),title:'foobar-title-*')),'1':('0':size,'1':1000),'2':('0':filter,'1':!()),'3':('0':query),'4':('0':index,'1':(fields:(),title:'foobar-title-*')),'5':('0':query,'1':(language:KQL,query:'tooltipField: foobar')),'6':('0':fieldsFromSource,'1':!(_id)),'7':('0':source,'1':!f),'8':('0':fields,'1':!(tooltipField,styleField)),'9':('0':filter,'1':!((meta:(),query:(exists:(field:bar)))))))", + requestBody: expect.any(String), token: '1234', }); + + // Verify requestBody data after decoding from Rison + const requestBody = params.get('requestBody'); + const requestBodyDecoded = requestBody ? decode(requestBody) : {}; + expect(requestBodyDecoded).toEqual({ + fields: { + '0': { '0': 'index', '1': { fields: {}, title: 'foobar-title-*' } }, + '1': { '0': 'size', '1': 1000 }, + '2': { '0': 'filter', '1': [] }, + '3': { '0': 'query' }, + '4': { '0': 'index', '1': { fields: {}, title: 'foobar-title-*' } }, + '5': { '0': 'query', '1': { language: 'KQL', query: 'tooltipField: foobar' } }, + '6': { '0': 'fieldsFromSource', '1': ['_id'] }, + '7': { '0': 'source', '1': false }, + '8': { '0': 'fields', '1': ['tooltipField', 'styleField'] }, + '9': { '0': 'filter', '1': [{ meta: {}, query: { exists: { field: 'bar' } } }] }, + }, + }); }); it('should include executionContextId when provided', async () => {