Skip to content
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

[Question]: is it as designed that trigger and mutate will follow dedupingInterval #271

Closed
mxschmitt opened this issue Feb 17, 2020 · 2 comments · Fixed by #279
Closed
Labels
bug Something isn't working

Comments

@mxschmitt
Copy link
Contributor

mxschmitt commented Feb 17, 2020

Hey,

small question: is it as designed, that a manual trigger will follow the dedupingInterval and don't invalidate the cached item if it was less than the dedupingInterval?

Example: https://codesandbox.io/s/quirky-albattani-ttfrw

Expected: On each button click the new time will be fetched

Actual: It only will be fetched if I click slower than 200ms (default dedupingInterval)

Version: 0.1.17

@rtxu
Copy link
Contributor

rtxu commented Feb 18, 2020

I encountered the same situation.

Not only trigger, but also mutate will be omitted when it starts in less than dedupingInterval since the latest revalidate.

swr version:0.1.12
default dedupingInterval: 2000ms

@mxschmitt mxschmitt changed the title [Question]: is it as designed that trigger will follow dedupingInterval [Question]: is it as designed that trigger and mutate will follow dedupingInterval Feb 20, 2020
@mxschmitt mxschmitt changed the title [Question]: is it as designed that trigger and mutate will follow dedupingInterval [Question]: is it as designed that trigger and mutate will follow dedupingInterval Feb 20, 2020
@shuding
Copy link
Member

shuding commented Feb 22, 2020

This must be a bug. By design trigger or mutate should never be deduped.

@shuding shuding added the bug Something isn't working label Feb 22, 2020
rtxu added a commit to rtxu/swr that referenced this issue Feb 22, 2020
shuding pushed a commit that referenced this issue Feb 24, 2020
* fix: disable dedupe when trigger/mutate (#271)

* fix failed build

* tests: show proof of the fix

Co-authored-by: Max Schmitt <max@schmitt.mx>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants