Skip to content

fix: Clear client caches when environment is reloaded#1509

Open
tpoliaw wants to merge 2 commits into
mainfrom
refresh-cache
Open

fix: Clear client caches when environment is reloaded#1509
tpoliaw wants to merge 2 commits into
mainfrom
refresh-cache

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@tpoliaw tpoliaw requested a review from a team as a code owner April 24, 2026 10:03
@tpoliaw tpoliaw linked an issue Apr 24, 2026 that may be closed by this pull request
@codecov

codecov Bot commented Apr 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.72%. Comparing base (4caaf19) to head (63521f2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1509      +/-   ##
==========================================
- Coverage   95.87%   95.72%   -0.16%     
==========================================
  Files          44       43       -1     
  Lines        3298     3229      -69     
==========================================
- Hits         3162     3091      -71     
- Misses        136      138       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@oliwenmandiamond

Copy link
Copy Markdown
Contributor

If I've done

bc = BlueapiClient(...)
plans = bc.plans
devices = bc.devices

and then do

>>>bc.reload_environment()

How does this affect objects plans and devices? Do I have to reassign plans and devices again

>>> plans = bc.plans
>>> devices = bc.devices

for them to pick up the new cache?

@tpoliaw

tpoliaw commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Do I have to reassign plans and devices again

Yes. It might be possible to mark them as invalid somehow but for now the caches would need updating

@abbiemery abbiemery left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There should be a test to check state has cleared. Could you add the check for these in there?

@tpoliaw tpoliaw force-pushed the refresh-cache branch 2 times, most recently from 0e25838 to 9747bc6 Compare June 24, 2026 13:06
@tpoliaw tpoliaw requested a review from abbiemery June 24, 2026 15:20
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.

Refreshing the environment should refresh the cached plans

3 participants