mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-30 23:24:16 +00:00
fix: prevent race condition by initializing scenario tracking after config is set
This commit is contained in:
@@ -105,9 +105,12 @@ const App = (): JSX.Element => {
|
|||||||
// Scenario-based health tracking: start ApplicationLoad and complete phases.
|
// Scenario-based health tracking: start ApplicationLoad and complete phases.
|
||||||
const { startScenario, completePhase } = useMetricScenario();
|
const { startScenario, completePhase } = useMetricScenario();
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
startScenario(MetricScenario.ApplicationLoad);
|
// Only start scenario after config is initialized to avoid race conditions
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// with message handlers that depend on configContext.platform
|
||||||
}, []);
|
if (config) {
|
||||||
|
startScenario(MetricScenario.ApplicationLoad);
|
||||||
|
}
|
||||||
|
}, [config, startScenario]);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
if (explorer) {
|
if (explorer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user