AlexsLemonade / refinebio-web

Refinebio Web
https://staging.web.refine.bio
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

161 - Implement DatasetMangerContext and useDatasetManeger hook using the latest tech stacks #169

Closed nozomione closed 1 year ago

nozomione commented 1 year ago

Issue Number

Closing #161

Total files changed : 32 (excluded ones that were simply renamed, rearranged, or removed comments) which includes some minor adjustments

Purpose/Implementation Notes

Implemented the following:

Please preview the latest UI here.

Types of changes

Functional tests

List out the functional tests you've completed to verify your changes work locally.

Checklist

vercel[bot] commented 1 year ago

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

Name Status Preview Comments Updated (UTC)
refinebio-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 5:41pm
nozomione commented 1 year ago

🗒️ @davidsmejia The backend cache (#164) is used in the DatasetRegenerate component (for expired datasets) to conditionally display the info message "Some expression values may differ. Why[link here]". And It works as expected, for currently the worker version v1.42.67-hotfix in a response body and x-source revision v1.45.27-hotfix in a response header differs (preview here)✅

davidsmejia commented 1 year ago

🗒️ @davidsmejia The backend cache (#164) is used in the DatasetRegenerate component (for expired datasets) to conditionally display the info message "Some expression values may differ. Why[link here]". And It works as expected, for currently the worker version v1.42.67-hotfix in a response body and x-source revision v1.45.27-hotfix in a response header differs (preview here)✅

This doesn't really make sense to me. If we are using the cache as a fallback to determine if the worker_version has changed it would either imply that the API is down and we can't regenerate the dataset currently.

If we use the cached value by default and that value only gets updated on deploys then we won't necessarily be aware if the BE had a deploy and version change. Meaning we wouldn't show the message after API deploys until a new FE deploy / cache regeneration.

nozomione commented 1 year ago

This doesn't really make sense to me. If we are using the cache as a fallback to determine if the worker_version has changed it would either imply that the API is down and we can't regenerate the dataset currently.

If we use the cached value by default and that value only gets updated on deploys then we won't necessarily be aware if the BE had a deploy and version change. Meaning we wouldn't show the message after API deploys until a new FE deploy / cache regeneration.

I've matched the refinebio-frontend implementation. Currently it compares the worker version with the x-source version (cached API version) to determine if the message should be displayed to users or not. If any requirements change, please let me know so that we may adjust the implementation. Thank you @davidsmejia

Also, it only checks the minor version change. Should we remove the cache from this file and evaluate the version change using a fetched response instead? If so, I'll make that update in #164, pls let me know.

nozomione commented 1 year ago

🗒️ The original issue will be divided into separate parts (context/hooks/helper implementations, UI implementations for pages), thus closing this PR.