feat(publish-quota): per user publishArticle quota#3862
feat(publish-quota): per user publishArticle quota#3862
Conversation
|
|
||
| const fieldName = 'publishArticle' | ||
| const pass = await checkOperationLimit({ | ||
| user: viewer.id || viewer.ip, |
There was a problem hiding this comment.
viewer.ip will never be used as only logged-in user can publish articles by now?
There was a problem hiding this comment.
And as opercation limit is checked here, rateLimitDirective (@ratelimit) on publishArticle in schema need to be removed
| trendy: 'trendy', | ||
| } as const | ||
|
|
||
| export const PUBLISH_ARTICLE_RATE_LIMIT = isProd ? 1 : 1000 |
There was a problem hiding this comment.
is this rate confirmed with the CC team?
There was a problem hiding this comment.
it was the default before:
"hotfix(publish-rate): reduce rate of publishArticle"
This reverts commit 2717c88.
| }) | ||
|
|
||
| if (!pass) { | ||
| throw new ActionLimitExceededError( |
There was a problem hiding this comment.
add unit test for this mutation changes?
There was a problem hiding this comment.
added in src/types/__test__/1/article.test.ts
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #3862 +/- ##
===========================================
+ Coverage 58.57% 58.59% +0.01%
===========================================
Files 887 890 +3
Lines 17184 17216 +32
Branches 3089 3095 +6
===========================================
+ Hits 10065 10087 +22
- Misses 7068 7078 +10
Partials 51 51 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fd27c9b to
c444559
Compare
|
how about Revert "hotfix(publish-rate): reduce rate of publishArticle" This reverts commit 2717c88. Let the graphql directive still handles a |
This reverts commit 2717c88.
resolves #3842