-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[dashboard] update feature flags only on demand #12800
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
Conversation
/werft run 👍 started the job as gitpod-build-ak-dashboard-lazy-experiments.1 |
const client = configcat.createClientWithLazyLoad(clientKey, { | ||
logger: configcat.createConsoleLogger(LogLevel.Error), | ||
pollIntervalSeconds: 60 * 3, // 3 minutes | ||
maxInitWaitTimeSeconds: 0, | ||
cacheTimeToLiveSeconds: 60 * 1, // 1 minute | ||
}); |
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'm not sure if this is desired behaviour from a UX perspective. This would block a UI element until the flags have been fetched.
What's the driver for this change?
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.
What's the driver for this change?
Just read the description as well.
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.
What's the driver for this change?
Each workspace page is loading the dashboard in iframe to show loading screen while workspace is not running. It causes a lot of requests each 3 minutes to ConfigCat, since the loading screen is present all the time in the background.
I'm not sure if this is desired behaviour from a UX perspective. This would block a UI element until the flags have been fetched.
We can reduce timeout time to 1500 milliseconds as we did in VS Code Desktop.
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 increased cache time to 3 mins and set timeout to 1500 milliseconds.
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.
Makes sense. I think I'm okay with this. Will just play around in preview.
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.
Also looking at the code it does not seem that it can block, since flags are computed from ConfigCat async in effect, so in worst case default values will be applied.
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.
Sorry, I should've been clearer. I meant block as in not show for example the Usage UI immediately, only after it's fetched.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went 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.
Sorry, I should've been clearer. I meant block as in not show for example the Usage UI immediately, only after it's fetched.
I don't think timing is changing. The client is created only on demand in use effect and it immediately calls getValueAsync
after creation. I think it was almost the same before.
If we want to improve timing we should create client at time of load the js module.
9f11578
to
cc06ad9
Compare
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.
Let's try this out.
Description
Each workspace page is loading the dashboard in iframe to show loading screen while workspace is not running. It causes a lot of requests each 3 minutes to ConfigCat, since the loading screen is present all the time in the background. This PR changes the strategy to update the settings values on demand and cache them for 3 minutes. For the workspace page it would mean no requests anymore. I don't think it makes big effect on other pages, but generally reduce amount of requests for the dashboard.
Related Issue(s)
Fixes #
How to test
Release Notes
Documentation
Werft options: