Closed vuon9 closed 3 years ago
Any idea how we can test this?
Which case u want to test? I think can do by unit tests.
I wasn't trying to be too fussy, just trying to figure out how we could exercise it, to know the code is OK. I ran the branch with cmc, seemed to work OK, but the bug was around stale caches etc.
Seems functional test with caching behavior, not about this fix, but about any fix relates to cached data, so I believe it's not simple. Assume it needs to warm up cache for the previous version of CMC coin data (ID = Name), then call the func to get coin (which prioritized cached data first), then have the comparison for actual/expect data.
What if the app just clear cache to have a fresh state by release? We may control it in a config file, like cache version or something like that. More than that, benefit in not to add clearing cache logic so many times if the fix relates to the cached data.
Until we have it, I may need to add clearing cache here, as I did in coinlink PR.
Created #291 to add feature for auto cache-clear. Happy to merge/close this one, but let's get 291 done before the next release.
279