-
Notifications
You must be signed in to change notification settings - Fork 12
fix(kno-10550): channel cache in slack and teams #809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(kno-10550): channel cache in slack and teams #809
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
kylemcd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emisilvacab We have the swr package installed in react-core. Wondering if we can utilize that to offload some of the caching logic?
|
@kylemcd We're using However, the This is the approach I arrived at but if you have any suggestions or alternative ideas, please let me know. |
8ef18eb to
98a9464
Compare
kylemcd
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we cover the missing lines and this should be good to go!
…ache-issue-on-combobox
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #809 +/- ##
==========================================
+ Coverage 65.51% 66.64% +1.13%
==========================================
Files 189 189
Lines 7797 7886 +89
Branches 956 999 +43
==========================================
+ Hits 5108 5256 +148
+ Misses 2662 2605 -57
+ Partials 27 25 -2
|
Description
Fixed channel cache issue in the SlackKit and also applied the same fix for the ms teams.
The problem was that
useSlackChannelshook was using SWR for fetching data with a cache key of["SLACK_CHANNELS", cursor], this key didn’t include thetenantIdorknockSlackChannelId. So when the user switched workspaces (different tenant) or disconnected from one slack server and connected to a new one, SWR would return the cached data from the previous connection since the cache key was the same.Checklist
Screenshots or videos
Vibecoded a small example to show this by switching tenants
Before
before.mov
After
after.mov