wandb / weave

Weave is a toolkit for developing AI-powered applications, built by Weights & Biases.
https://wandb.me/weave
Apache License 2.0
659 stars 49 forks source link

fix: useCall can set stale cache results #2200

Closed gtarpenning closed 3 weeks ago

gtarpenning commented 3 weeks ago

Pernicious little bug that was causing me hassles. Not sure of the best way to fix this, but this does solve the problem...

useCall is a hook, so we expect keys to change and have the result change as well. As written in master, while we handle key changes (with deepmemo), we actually return the previous result before calling doFetch. We not only return the old result, but we set the cache with the new key to the old result!

Note: I think this affects all the hooks that use this pattern...

circle-job-mirror[bot] commented 3 weeks ago

Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=915330093eb4f8d47b3d5c99ac15f25eb94f149b