Skip to content

fix: ensure global vars load properly on first flow - #12538

Merged
lucaseduoli merged 5 commits into
release-1.9.0from
fix-globalvar-firstload
Apr 8, 2026
Merged

fix: ensure global vars load properly on first flow#12538
lucaseduoli merged 5 commits into
release-1.9.0from
fix-globalvar-firstload

Conversation

@erichare

@erichare erichare commented Apr 6, 2026

Copy link
Copy Markdown
Member

This pull request addresses a race condition in the global variable loading logic for the InputGlobalComponent. The changes ensure that values are not incorrectly cleared or reset while the global variables are still being fetched, which could previously result in references being wiped on initial load. The update introduces a guard using the isGlobalVariablesFetched flag to synchronize state updates with the completion of the global variables query.

Key improvements include:

Race Condition Fixes & Data Fetch Synchronization:

  • Added the isGlobalVariablesFetched flag from the useGetGlobalVariables hook and passed it through to the relevant hooks and effects in InputGlobalComponent and its hooks. This ensures that state updates only occur after the global variables have finished loading, preventing premature clearing of values. [1] [2] [3] [4]
  • Updated the cleanup and initial load effects to guard on isGlobalVariablesFetched, preventing race conditions during the first flow load. [1] [2]

Code Cleanup:

  • Removed unused imports (such as useCallback) from hooks.ts for improved code clarity.

These changes collectively make the component more robust against asynchronous data-fetching issues and improve maintainability.

@erichare
erichare requested a review from lucaseduoli April 6, 2026 22:14
@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 05c9128f-391b-4c41-b041-74e9395fbc92

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-globalvar-firstload

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the bug Something isn't working label Apr 6, 2026
@codecov

codecov Bot commented Apr 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.33%. Comparing base (749865b) to head (03d9feb).
⚠️ Report is 6 commits behind head on release-1.9.0.

❌ Your project status has failed because the head coverage (49.60%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-1.9.0   #12538      +/-   ##
=================================================
- Coverage          52.44%   52.33%   -0.12%     
=================================================
  Files               2013     2013              
  Lines             182368   181691     -677     
  Branches           28433    25761    -2672     
=================================================
- Hits               95646    95080     -566     
+ Misses             85648    85536     -112     
- Partials            1074     1075       +1     
Flag Coverage Δ
backend 55.66% <ø> (-0.06%) ⬇️
frontend 52.21% <100.00%> (-0.16%) ⬇️
lfx 49.60% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...Component/components/inputGlobalComponent/hooks.ts 85.71% <100.00%> (+29.61%) ⬆️
...omponent/components/inputGlobalComponent/index.tsx 92.02% <100.00%> (+46.93%) ⬆️

... and 94 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 33%
33.73% (38286/113501) 66.63% (5115/7676) 34.98% (899/2570)

Unit Test Results

Tests Skipped Failures Errors Time
3705 0 💤 0 ❌ 0 🔥 6m 18s ⏱️

@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Apr 6, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Apr 6, 2026

@lucaseduoli lucaseduoli left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Apr 7, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Apr 8, 2026
@lucaseduoli
lucaseduoli enabled auto-merge April 8, 2026 19:53
@lucaseduoli lucaseduoli changed the title fix: Ensure global vars load properly on first flow fix: ensure global vars load properly on first flow Apr 8, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Apr 8, 2026
@lucaseduoli
lucaseduoli added this pull request to the merge queue Apr 8, 2026
Merged via the queue into release-1.9.0 with commit eff08ee Apr 8, 2026
193 of 196 checks passed
@lucaseduoli
lucaseduoli deleted the fix-globalvar-firstload branch April 8, 2026 21:20
Adam-Aghili pushed a commit that referenced this pull request Apr 15, 2026
* fix: Ensure global vars load properly on first flow

* Add tests

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Adam-Aghili pushed a commit that referenced this pull request Apr 15, 2026
* fix: Ensure global vars load properly on first flow

* Add tests

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants