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

Fix: Ignore KCL changes when loading settings and fixed useEffect to use .current #5126

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

nadr0
Copy link
Collaborator

@nadr0 nadr0 commented Jan 21, 2025

Issue

  • I wrote wrong react logic for prev/curr useEffect checking. I shouldn't have used the getter I should have used the .current
  • When editing any .kcl file in a project while in the model scene all of the settings reload from disk into memory

Implementation

  • Removed my poor logic to use the .current from the getter
  • Implemented a check to exit early when reading settings from disk. It should only update if one of two files match

Any time we edited a .kcl file from code mods or if the user is typing it would reload all of the project settings from disk into memory. That logic does not need to run. By writing the wrong react API logic I uncovered that the settings were constantly being reloaded from disk because my getter kept getting set again even though the .current value inside was not changing. I am glad I wrote the line of code wrong to find this.

…cher to not watch .kcl files when loading settings
Copy link

vercel bot commented Jan 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Jan 31, 2025 7:06pm

Copy link

qa-wolf bot commented Jan 21, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link
Collaborator

@franknoirot franknoirot left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is probably our WS BS that we're dealing with right now.

Copy link

codecov bot commented Jan 31, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.94%. Comparing base (f8f4474) to head (4e72aa7).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5126   +/-   ##
=======================================
  Coverage   85.94%   85.94%           
=======================================
  Files          90       90           
  Lines       32718    32718           
=======================================
  Hits        28121    28121           
  Misses       4597     4597           
Flag Coverage Δ
wasm-lib 85.94% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

Successfully merging this pull request may close these issues.

2 participants