Skip to content

Refresh routes on launch #1132

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

Open
jfschwarz opened this issue Mar 20, 2025 · 2 comments
Open

Refresh routes on launch #1132

jfschwarz opened this issue Mar 20, 2025 · 2 comments

Comments

@jfschwarz
Copy link
Collaborator

When a role is added after a route has already been stored in the extension storage it will not show up and not be taken into account on our automatic role selection.

We should refresh and validate routes

  • when launching pilot (for the currently selected route)
  • when switching to a new route
  • when opening the submit page
@frontendphil
Copy link
Member

@jfschwarz How would you do that, given that there can be multiple routes from A to B? Given that this sounds like a property update on a waypoint of a route, would an update route method in ser-kit make sense?

import { refreshRoute } from 'ser-kit'

const updatedRoute = await refreshRoute(currentRoute)

This seems relatively safe, given we wouldn't interfere with the general setup (which waypoints to use). However, I'm not a super big fan of updating things as a side-effect. More so because this sounds like something that happens sometimes but not all the time which means we're always slowing things down because sometimes stuff happens.

What if, instead, we don't add the role to a route and figure it out dynamically when we plan the execution? Would that make more sense?

@jfschwarz
Copy link
Collaborator Author

We need the roles already for the permissions checks in the panel.

A refreshRoute function in ser-kit sounds good. We could integrate it into Pilot with a stale-while-revalidate approach to not slow down anything in the UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants