Skip to content

fix: Clear client caches when environment is reloaded - #1509

Merged
tpoliaw merged 2 commits into
mainfrom
refresh-cache
Jun 25, 2026
Merged

tpoliaw merged 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.91%. Comparing base (50fd3dd) to head (7caf8a9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1509   +/-   ##
=======================================
  Coverage   95.90%   95.91%           
=======================================
  Files          44       44           
  Lines        3250     3255    +5     
=======================================
+ Hits         3117     3122    +5     
  Misses        133      133           

☔ 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 3 times, most recently from 9747bc6 to 63521f2 Compare June 24, 2026 13:08
@tpoliaw
tpoliaw requested a review from abbiemery June 24, 2026 15:20

@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.

LGTM

@tpoliaw
tpoliaw added this pull request to the merge queue Jun 25, 2026
Merged via the queue into main with commit bd58313 Jun 25, 2026
19 checks passed
@tpoliaw
tpoliaw deleted the refresh-cache branch June 25, 2026 11:14
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