-
Notifications
You must be signed in to change notification settings - Fork 152
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
[GH-613]:Fixed issue "API rate limit exceeded for user ID". #626
Conversation
* [MI-2481]:Fixed issue mattermost#681 on github * [MI-2481]:Fixed review fixes * [MI-2481]:Fixed review fixes * [MI-2481]:Fixed review fixes
Hello @Kshitij-Katiyar, Thanks for your pull request! A Core Committer will review your pull request soon. For code contributions, you can learn more about the review process here. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #626 +/- ##
==========================================
- Coverage 15.63% 15.51% -0.13%
==========================================
Files 15 15
Lines 5518 5543 +25
==========================================
- Hits 863 860 -3
- Misses 4613 4641 +28
Partials 42 42
☔ View full report in Codecov by Sentry. |
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.
Great work on this @Kshitij-Katiyar 👍 I have just a few requests
* [MI-2547]:Fixed review fixes for Github issue 613 and PR 626 * [MI-2547]:Fixed review fixes * [MI-2547]:Fixed review fixes
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.
Just one remaining request to avoid returning nil
, and a few suggestions. Otherwise LGTM 👍
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.
LGTM! Thanks @Kshitij-Katiyar
/update-branch |
We don't have permissions to update this PR, please contact the submitter to apply the update. |
This PR has been automatically labelled "stale" because it hasn't had recent activity. |
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.
Really nice work 💯
A few non-blocking comments below
@Kshitij-Katiyar I have this deployed to take another look... I have the last commit deployed. I followed my steps from earlier this year. #626 (comment) Can you please see if you can reproduce this? |
@Kshitij-Katiyar 0/5 This might only repo with account data I have.
Please advise. |
@DHaussermann I have fixed the above issue. Just needed a minor change. Please test this again |
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.
Tested and passed.
This now passes functional testing.
- Ensured web app will periodically fetch updated counts when they have changed
- Refresh option works to get new counts right away
- Panic form comment above ☝️ is resolved
- No sign of rate limit issue is server logs anymore
LGTM!
@hanzei and @mickmister, I re-requested dev review but I'm now seeing there were not too many commits since last round. 1 dev re-review would probably have been plenty. Sorry I though Dev review approvals were much older as this task has been going for some time now. |
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.
A few new nitpicks
server/plugin/graphql/lhs_request.go
Outdated
|
||
if !flagAssignee { | ||
for _, resp := range mainQuery.Assignee.Nodes { | ||
resp := resp |
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.
Why?
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.
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.
The resp := resp
looks a little off to me. Alternatively we could do this:
for i := range mainQuery.Assignee.Nodes {
resp := mainQuery.Assignee.Nodes[i]
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.
sure @mickmister
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 for this @Kshitij-Katiyar! I gave this another review. Nothing blocking, just leaving some comments
break | ||
} | ||
|
||
if err := c.executeQuery(ctx, &mainQuery, params); err != nil { |
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.
Are we ever fetching duplicate data here? e.g. If flagOpenPR
is true, do we still request some PR data from GitHub?
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.
There could be a time when one of the 3 is nil but other entry still have some data to fetch. In that case we still need to call the API as we want to get the other part of the data and there is only 1 API call and a single query happening here. @mickmister
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.
Just a few more naming suggestions
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.
I accidentally approved sorry about that. Please see the requested changes above
@DHaussermann Can you please give this another pass when you have the chance? cc @mkdbns |
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.
Tested and passed
- Repeated testing
- Counts update
- Refresh option is functional
- Still no sign of rate limit issue in logs
LGTM!
Summary
User's mattermost logs were full of API rate limit exceeded warn message due to many API calls simultaneously. Mainly due to the notifications count on the mattermost sidebar.
Please refer to this comment for further information:- API rate limit exceeded for user ID #613 (comment)
Issue #613