-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Feedback Needed][Search] Use session service on a dashboard #81192
Conversation
@@ -1109,12 +1111,6 @@ export class DashboardAppController { | |||
$scope.model.filters = filterManager.getFilters(); | |||
$scope.model.query = queryStringManager.getQuery(); | |||
dashboardStateManager.applyFilters($scope.model.query, $scope.model.filters); | |||
if (dashboardContainer) { | |||
dashboardContainer.updateInput({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -590,7 +591,8 @@ export class DashboardAppController { | |||
const refreshDashboardContainer = () => { | |||
const changes = getChangesFromAppStateForContainerState(); | |||
if (changes && dashboardContainer) { | |||
dashboardContainer.updateInput(changes); | |||
const sessionId = searchService.session.start(); | |||
dashboardContainer.updateInput({ ...changes, searchSessionId: sessionId }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 Out
Stack Trace
Metrics [docs]async chunks size
page load bundle size
To update your PR or re-run it, just comment with: |
@@ -590,7 +591,8 @@ export class DashboardAppController { | |||
const refreshDashboardContainer = () => { | |||
const changes = getChangesFromAppStateForContainerState(); | |||
if (changes && dashboardContainer) { | |||
dashboardContainer.updateInput(changes); | |||
const sessionId = searchService.session.start(); | |||
dashboardContainer.updateInput({ ...changes, searchSessionId: sessionId }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -84,4 +84,5 @@ export interface ExecutionContextSearch { | |||
filters?: Filter[]; | |||
query?: Query | Query[]; | |||
timeRange?: TimeRange; | |||
sessionId?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's probably best if we stick to searchSessionId
here and below. I think it's more explicit.
@@ -248,7 +252,7 @@ export const esaggs = (): EsaggsExpressionFunctionDefinition => ({ | |||
multi: true, | |||
}, | |||
}, | |||
async fn(input, args, { inspectorAdapters, abortSignal }) { | |||
async fn(input, args, { inspectorAdapters, abortSignal, search }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Rebuilding this pr on top of #80643
Closing in favour of #81297 (wip). |
Summary
Follow up on #76889
Uses session service on a dashboard.
Notes:
sessionId
displayed in inspector. Plan to use it in a functional test.Checklist
Delete any items that are not applicable to this PR.
For maintainers