-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix(suspensive.org): add defense code for github contributors fetching #1054
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@saul-atomrigs is attempting to deploy a commit to the Toss Team on Vercel. A member of the Team first needs to authorize it. |
CodSpeed Performance ReportMerging #1054 will create unknown performance changesComparing Summary
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1054 +/- ##
=======================================
Coverage 84.09% 84.09%
=======================================
Files 49 49
Lines 547 547
Branches 118 118
=======================================
Hits 460 460
Misses 82 82
Partials 5 5
|
if (Array.isArray(data) && data.length) { | ||
const filteredContributors = data.filter((contributor) => { | ||
const login = contributor.author.login | ||
return !['github-actions[bot]', 'dependabot[bot]', 'renovate[bot]'].includes(login) | ||
}) | ||
setResult({ | ||
data: filteredContributors, | ||
error: undefined, | ||
isError: false, | ||
isLoading: false, | ||
isSuccess: true, | ||
}) | ||
} |
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.
Even if the data is not an array or the length is 0, the fetch success status must be expressed as state. Please modify isSuccess to be true so that the correct server status state can be displayed even if the length of the data is 0 or there is no data when the fetch is successful.
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.
thank you, I've just pushed the change
It will keep isSuccess
true for all 200 OK, even though the response data is empty or non-array
plus, I refactored the code for better exception messages
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.
Thanks!
…data or other than array
#1054) # Overview <!-- A clear and concise description of what this pr is about. --> Issue: #1051 I was able to reproduce the bug only by the time this issue was posted. Afterwards, I tried clearing the cache, browsing in secret mode, and even in another macbook (which never visited the page before) and in several browsers (chrome, safari, opera, edge), I couldn't reproduce the bug again... for now I added some defense code to where the error log pointed: ![Captura de pantalla 2024-07-08 a las 8 02 06 p m](https://github.com/toss/suspensive/assets/82362278/5e1b6343-e6aa-4dad-a102-35b08dd85d47) I'll keep an eye on this issue. ## PR Checklist - [✅] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests.
#1054) # Overview <!-- A clear and concise description of what this pr is about. --> Issue: #1051 I was able to reproduce the bug only by the time this issue was posted. Afterwards, I tried clearing the cache, browsing in secret mode, and even in another macbook (which never visited the page before) and in several browsers (chrome, safari, opera, edge), I couldn't reproduce the bug again... for now I added some defense code to where the error log pointed: ![Captura de pantalla 2024-07-08 a las 8 02 06 p m](https://github.com/toss/suspensive/assets/82362278/5e1b6343-e6aa-4dad-a102-35b08dd85d47) I'll keep an eye on this issue. ## PR Checklist - [✅] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests.
#1054) # Overview <!-- A clear and concise description of what this pr is about. --> Issue: #1051 I was able to reproduce the bug only by the time this issue was posted. Afterwards, I tried clearing the cache, browsing in secret mode, and even in another macbook (which never visited the page before) and in several browsers (chrome, safari, opera, edge), I couldn't reproduce the bug again... for now I added some defense code to where the error log pointed: ![Captura de pantalla 2024-07-08 a las 8 02 06 p m](https://github.com/toss/suspensive/assets/82362278/5e1b6343-e6aa-4dad-a102-35b08dd85d47) I'll keep an eye on this issue. ## PR Checklist - [✅] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests.
#1054) # Overview <!-- A clear and concise description of what this pr is about. --> Issue: #1051 I was able to reproduce the bug only by the time this issue was posted. Afterwards, I tried clearing the cache, browsing in secret mode, and even in another macbook (which never visited the page before) and in several browsers (chrome, safari, opera, edge), I couldn't reproduce the bug again... for now I added some defense code to where the error log pointed: ![Captura de pantalla 2024-07-08 a las 8 02 06 p m](https://github.com/toss/suspensive/assets/82362278/5e1b6343-e6aa-4dad-a102-35b08dd85d47) I'll keep an eye on this issue. ## PR Checklist - [✅] I did below actions if need 1. I read the [Contributing Guide](https://github.com/toss/suspensive/blob/main/CONTRIBUTING.md) 2. I added documents and tests.
Overview
Issue: #1051
I was able to reproduce the bug only by the time this issue was posted. Afterwards, I tried clearing the cache, browsing in secret mode, and even in another macbook (which never visited the page before) and in several browsers (chrome, safari, opera, edge), I couldn't reproduce the bug again... for now I added some defense code to where the error log pointed:
I'll keep an eye on this issue.
PR Checklist