[Feedback Needed][Search] Use session service on a dashboard#81192
[Feedback Needed][Search] Use session service on a dashboard#81192Dosant wants to merge 1 commit intoelastic:masterfrom
Conversation
| $scope.model.query = queryStringManager.getQuery(); | ||
| dashboardStateManager.applyFilters($scope.model.query, $scope.model.filters); | ||
| if (dashboardContainer) { | ||
| dashboardContainer.updateInput({ |
There was a problem hiding this comment.
This is not needed and handled by refreshDashboardContainer. Looking forward to this file being refactored.
If keep it as is, the it would create redundant session ids.
| if (changes && dashboardContainer) { | ||
| dashboardContainer.updateInput(changes); | ||
| const sessionId = searchService.session.start(); | ||
| dashboardContainer.updateInput({ ...changes, searchSessionId: sessionId }); |
There was a problem hiding this comment.
@lizozom, @lukasolson, @ppisljar, I am passing the sessionId down the pipeline (#76889 (comment)). Is this the correct approach or do we want sessionService to be accessed somewhere down the pipe directly?
If this is the preferred approach, then what is the need for global sessionService ?
There was a problem hiding this comment.
Ideally, we wouldn't need the global sessionService state. We'd just be passing the sessionId around. However, I think the intent of the global state was in case we didn't have the necessary pipeline to send the sessionId all the way from the application, through embeddables and expression service, to the search service. @lizozom Correct me if I'm wrong.
There was a problem hiding this comment.
if i remember correctly initially we were discussing accessing the session directly but since we figured we will have searches which we don't want to be part of the session, so we'll need to be passing them down
💔 Build Failed
Failed CI StepsTest FailuresChrome UI Functional Tests.test/functional/apps/management/_test_huge_fields·js.management test large number of fields "before all" hook for "test_huge data should have expected number of fields"Standard OutStack TraceMetrics [docs]async chunks size
page load bundle size
To update your PR or re-run it, just comment with: |
| if (changes && dashboardContainer) { | ||
| dashboardContainer.updateInput(changes); | ||
| const sessionId = searchService.session.start(); | ||
| dashboardContainer.updateInput({ ...changes, searchSessionId: sessionId }); |
There was a problem hiding this comment.
Ideally, we wouldn't need the global sessionService state. We'd just be passing the sessionId around. However, I think the intent of the global state was in case we didn't have the necessary pipeline to send the sessionId all the way from the application, through embeddables and expression service, to the search service. @lizozom Correct me if I'm wrong.
| filters?: Filter[]; | ||
| query?: Query | Query[]; | ||
| timeRange?: TimeRange; | ||
| sessionId?: string; |
There was a problem hiding this comment.
I think it's probably best if we stick to searchSessionId here and below. I think it's more explicit.
| }, | ||
| }, | ||
| async fn(input, args, { inspectorAdapters, abortSignal }) { | ||
| async fn(input, args, { inspectorAdapters, abortSignal, search }) { |
There was a problem hiding this comment.
Does it make sense to add this as part of args instead of handlers? Or is it even feasible?
I guess I'm not even sure how this is being passed in... Was search being passed in prior to this PR inside the third argument here?
There was a problem hiding this comment.
it will need to be a handler, i wouldn't include it as part of initial input however to make it more explicit and would prefer a separate getter function on the handlers
| /** | ||
| * Search session id to group searches | ||
| */ | ||
| searchSessionId?: string; |
There was a problem hiding this comment.
lets make a separate handler for this getSessionId(): string | undefined ...
I actually started looking into this last week, but then got distracted by some type cleanup: #80643
|
Closing in favour of #81297 (wip). |
Summary
Follow up on #76889
Uses session service on a dashboard.
Notes:
sessionIddisplayed in inspector. Plan to use it in a functional test.Checklist
Delete any items that are not applicable to this PR.
For maintainers