Skip to content
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

Execution context remains the same on every route change #195778

Open
eokoneyo opened this issue Oct 10, 2024 · 3 comments · May be fixed by #201118 or #200785
Open

Execution context remains the same on every route change #195778

eokoneyo opened this issue Oct 10, 2024 · 3 comments · May be fixed by #201118 or #200785
Assignees
Labels
bug Fixes for quality problems that affect the customer experience SharedUX/fix-it-week Bugs that have been groomed and queued up for the team's next fix it week Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)

Comments

@eokoneyo
Copy link
Contributor

Kibana version:
main (8.15)

Describe the bug:

This issue was reported by on slack, it seems the pageName in the execution context remains the same on every route change. Ideally the on route change the we should set the values of the execution, this typically includes pageName, alongside couple of other values. On investigating this it seems the implementation to gather the details for the current page's context does exist, however it doesn't get persisted to the execution context instance because it's also undefined within said implementation, hence why subscribers receive a stale value

Steps to reproduce:

  1. Open up the use_execution_context.ts file, add in the following
console.log('executionContext:: %o , context to update:: %o \n', executionContext, context);
  1. on navigating through pages in app, we'll consistently notice that the value for execution context instance is undefined, with context value actually updating.

Expected behavior:

  • Context value computed on route change should be persisted to the execution context instance of the app
@eokoneyo eokoneyo added bug Fixes for quality problems that affect the customer experience SharedUX/fix-it-week Bugs that have been groomed and queued up for the team's next fix it week Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) labels Oct 10, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@Dosant
Copy link
Contributor

Dosant commented Oct 11, 2024

My guess is that this got broken when we moved the sharedux router to packages (a while ago). We probably lost context that was picked up from kibana_react. The fix should probably be to add this context to KibanaRenderContextProvider and use it from there. This only be fixed for
the places that use the provider

@Dosant Dosant self-assigned this Oct 21, 2024
@Dosant
Copy link
Contributor

Dosant commented Oct 21, 2024

I took a look, I believe this is the context, hope I got it correctly:

So atm and for quite a while, I believe, only the places where we explicitly call useExecutionContext from
import { useExecutionContext } from '@kbn/kibana-react-plugin/public'; or executionContext.set directly correctly set the execution context

@afharo afharo linked a pull request Nov 19, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience SharedUX/fix-it-week Bugs that have been groomed and queued up for the team's next fix it week Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience)
Projects
None yet
3 participants