-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Search] Client side session service #76889
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
Merged
lizozom
merged 98 commits into
elastic:master
from
lizozom:search/client-session-service
Oct 16, 2020
Merged
Changes from 91 commits
Commits
Show all changes
98 commits
Select commit
Hold shift + click to select a range
1396af4
Add a session service and use it in discover and dashboard
7bc93c3
check unefined
e6f31d8
Merge branch 'master' of github.com:elastic/kibana into search/client…
7de920f
Start session in visualize
b6eac29
Merge branch 'master' of github.com:elastic/kibana into search/client…
9615706
Fix tests
812015d
Merge branch 'master' of github.com:elastic/kibana into search/client…
739dde9
docs
a9dec42
Merge branch 'master' of github.com:elastic/kibana into search/client…
63c04d3
OSS error alignemnt
fc6d3c2
Adjust error messages in xpack
154a146
Add getErrorMessage
12e7898
Use showError in vizualize
f1390e2
Cleanup
1f9c340
ts, doc and i18n fixes
e6a794d
Fix jest tests
13be80c
Fix functional test
3e9dc9b
functional test
6f0b080
ts
4f73686
Merge branch 'master' of github.com:elastic/kibana into search/error-…
021d12f
Update functional tests
3035450
Add unit tests to interceptor and timeout error
dd48dd2
expose toasts test function
21b44b7
doc
aaa08cc
typos
5a8dee8
Merge branch 'master' of github.com:elastic/kibana into search/client…
8e09b74
lint
396578d
Cleanup
f6fbb08
Merge branch 'master' of github.com:elastic/kibana into search/error-…
551335d
review 1
9b0e7ca
Merge branch 'master' of github.com:elastic/kibana into search/error-…
57b2a74
Code review
848eb0c
doc
4e6f47d
doc fix
741e8cd
visualization type fix
40c9411
fix jest
2c3d594
Fix xpack functional test
1142434
Merge branch 'master' of github.com:elastic/kibana into search/error-…
af29d63
Merge branch 'master' of github.com:elastic/kibana into search/client…
a7fcea4
Merge branch 'master' of github.com:elastic/kibana into search/client…
9c6972b
fix xpack test
a9a1715
Merge branch 'master' of github.com:elastic/kibana into search/error-…
ecd5cce
code review
8abced8
Merge branch 'master' of github.com:elastic/kibana into search/client…
0f956c0
Merge branch 'search/error-alignment' into search/client-session-service
eed53fb
Add tracking methods to session service
9b13bf9
Merge branch 'master' of github.com:elastic/kibana into search/client…
990aba6
Merge branch 'master' of github.com:elastic/kibana into search/client…
36400f0
remove chromium
8a25855
Merge branch 'master' of github.com:elastic/kibana into search/client…
7b432ea
Fix ts and jest tests
2c8e9ea
jest + docs
fc33904
ts fix
dd7da3f
siem test
862d53a
Merge branch 'master' of github.com:elastic/kibana into search/client…
db7ea0e
Use session service to show a timeout notification per session + more…
cd2bc82
ts and docs
b4034c2
Remove session service from search source (not needed)
3c0331f
Merge branch 'master' of github.com:elastic/kibana into search/client…
b7e441d
Merge branch 'master' of github.com:elastic/kibana into search/client…
92de71d
Code review
b07a802
ts
b5beec7
Merge branch 'master' of github.com:elastic/kibana into search/client…
2c503b8
Single active session in FE session service
26e8539
Merge branch 'master' into search/client-session-service
kibanamachine abffc40
Cleanup
6ce7fa9
Don't integrate with dashboard \ visualize
8ae20f7
Merge branch 'search/client-session-service' of github.com:lizozom/ki…
936391b
Merge branch 'master' of github.com:elastic/kibana into search/client…
10e239b
Typescript
fc8a3f8
ts
5597cab
Merge branch 'master' of github.com:elastic/kibana into search/client…
31189dc
Improve functional tests
40ba6c7
Merge branch 'master' of github.com:elastic/kibana into search/client…
beb00b9
es
607f7ab
Merge branch 'master' into search/client-session-service
kibanamachine 24310bd
simplify filter test
ed3d8c0
Merge branch 'master' of github.com:elastic/kibana into search/client…
8b557ab
Merge branch 'search/client-session-service' of github.com:lizozom/ki…
ea0724b
wait until loadedw
d60d97d
filter test
1f0524e
delete crypto for now
87518d4
Merge branch 'master' of github.com:elastic/kibana into search/client…
da7850a
Select the correct index :facepalm:
b7f00c5
timerange
fac858d
Merge branch 'master' of github.com:elastic/kibana into search/client…
c064626
Adjust functional test logic
3924dfd
improved test format @dosant
5365204
Merge branch 'master' of github.com:elastic/kibana into search/client…
1483a41
Merge branch 'master' of github.com:elastic/kibana into search/client…
c8294b6
Handle exceptions
52aa231
Don't close sessions automatically, warn instead
798dc5e
jest
e181864
Adjust functional test
0cca933
Merge branch 'master' of github.com:elastic/kibana into search/client…
69179e6
Merge branch 'master' of github.com:elastic/kibana into search/client…
a2f9b65
Remove unused code
4d11ab6
delete export
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ugins/data/public/kibana-plugin-plugins-data-public.isearchoptions.sessionid.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchOptions](./kibana-plugin-plugins-data-public.isearchoptions.md) > [sessionId](./kibana-plugin-plugins-data-public.isearchoptions.sessionid.md) | ||
|
|
||
| ## ISearchOptions.sessionId property | ||
|
|
||
| A session ID, grouping multiple search requests into a single session. | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| sessionId?: string; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...t/plugins/data/public/kibana-plugin-plugins-data-public.isearchsetup.session.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchSetup](./kibana-plugin-plugins-data-public.isearchsetup.md) > [session](./kibana-plugin-plugins-data-public.isearchsetup.session.md) | ||
|
|
||
| ## ISearchSetup.session property | ||
|
|
||
| session management | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| session: ISessionService; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...t/plugins/data/public/kibana-plugin-plugins-data-public.isearchstart.session.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [ISearchStart](./kibana-plugin-plugins-data-public.isearchstart.md) > [session](./kibana-plugin-plugins-data-public.isearchstart.session.md) | ||
|
|
||
| ## ISearchStart.session property | ||
|
|
||
| session management | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| session: ISessionService; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../data/public/kibana-plugin-plugins-data-public.searchinterceptordeps.session.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) > [SearchInterceptorDeps](./kibana-plugin-plugins-data-public.searchinterceptordeps.md) > [session](./kibana-plugin-plugins-data-public.searchinterceptordeps.session.md) | ||
|
|
||
| ## SearchInterceptorDeps.session property | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| session: ISessionService; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...ugins/data/server/kibana-plugin-plugins-data-server.isearchoptions.sessionid.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
|
||
| [Home](./index.md) > [kibana-plugin-plugins-data-server](./kibana-plugin-plugins-data-server.md) > [ISearchOptions](./kibana-plugin-plugins-data-server.isearchoptions.md) > [sessionId](./kibana-plugin-plugins-data-server.isearchoptions.sessionid.md) | ||
|
|
||
| ## ISearchOptions.sessionId property | ||
|
|
||
| A session ID, grouping multiple search requests into a single session. | ||
|
|
||
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| sessionId?: string; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| export { getSessionServiceMock } from './search/session/mocks'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| export * from './types'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { ISessionService } from './types'; | ||
|
|
||
| export function getSessionServiceMock(): jest.Mocked<ISessionService> { | ||
| return { | ||
| clear: jest.fn(), | ||
| start: jest.fn(), | ||
| getSessionId: jest.fn(), | ||
| getSession$: jest.fn(), | ||
| }; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { Observable } from 'rxjs'; | ||
|
|
||
| export interface ISessionService { | ||
| /** | ||
| * Returns the active session ID | ||
| * @returns The active session ID | ||
| */ | ||
| getSessionId: () => string | undefined; | ||
lizozom marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /** | ||
| * Returns the observable that emits an update every time the session ID changes | ||
| * @returns `Observable` | ||
| */ | ||
| getSession$: () => Observable<string | undefined>; | ||
| /** | ||
| * Starts a new session | ||
| */ | ||
| start: () => string; | ||
| /** | ||
| * Clears the active session. | ||
| */ | ||
| clear: () => void; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| /* | ||
| * Licensed to Elasticsearch B.V. under one or more contributor | ||
| * license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright | ||
| * ownership. Elasticsearch B.V. licenses this file to you under | ||
| * the Apache License, Version 2.0 (the "License"); you may | ||
| * not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, | ||
| * software distributed under the License is distributed on an | ||
| * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| * KIND, either express or implied. See the License for the | ||
| * specific language governing permissions and limitations | ||
| * under the License. | ||
| */ | ||
|
|
||
| import { tapOnce } from './tap_once'; | ||
| import { from } from 'rxjs'; | ||
|
|
||
| describe('tapOnce', () => { | ||
| test('should fire on the first item of a stream, without interrupting it', async (done) => { | ||
| const tester = jest.fn(); | ||
| const nextTester = jest.fn(); | ||
| from([1, 2, 3, 4]) | ||
| .pipe(tapOnce(tester)) | ||
| .subscribe({ | ||
| next: (v) => { | ||
| nextTester(v); | ||
| }, | ||
| complete: () => { | ||
| expect(nextTester).toBeCalledTimes(4); | ||
| expect(tester).toBeCalledWith(1); | ||
| done(); | ||
| }, | ||
| }); | ||
| }); | ||
|
|
||
| test('fires once even when there are multiple subscriptions', async (done) => { | ||
| const tester = jest.fn(); | ||
|
|
||
| const source = from([1, 2, 3, 4]).pipe(tapOnce(tester)); | ||
|
|
||
| source.subscribe(() => {}); | ||
| source.subscribe({ | ||
| next: () => {}, | ||
| complete: () => { | ||
| expect(tester).toBeCalledWith(1); | ||
| expect(tester).toBeCalledTimes(1); | ||
| done(); | ||
| }, | ||
| }); | ||
| }); | ||
|
|
||
| test('fires once even when there is an error', async (done) => { | ||
|
||
| const tester = jest.fn().mockImplementation(() => { | ||
| throw new Error(); | ||
| }); | ||
|
|
||
| const source = from([1, 2, 3, 4]).pipe(tapOnce(tester)); | ||
|
|
||
| source.subscribe(() => {}); | ||
| source.subscribe({ | ||
| next: () => {}, | ||
| complete: () => { | ||
| expect(tester).toBeCalledWith(1); | ||
| expect(tester).toBeCalledTimes(1); | ||
| done(); | ||
| }, | ||
| }); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.