Benjol / SE-AutoReviewComments

AutoReviewComments - Pro-forma comments for SE
http://stackapps.com/q/2116
98 stars 39 forks source link

Why does the autocomment window seem to load forever (moving dots)? #128

Closed Franck-Dernoncourt closed 5 years ago

Franck-Dernoncourt commented 7 years ago

Why does the autocomment window seem to load forever (the dots keep moving)?

se autocomment load

I use the Google chrome extension.

Benjol commented 7 years ago

Dunno, that's the part where the extension is trying to recover user information to display. I've just tried it in chrome on that exact same question and it works for me :) Have you got some extensions which might block ajax requests?

On 14 January 2017 at 16:43, Franck Dernoncourt notifications@github.com wrote:

Why does the autocomment window seem to load forever (the dots keep moving)?

[image: se autocomment load] https://cloud.githubusercontent.com/assets/15331/21956061/08fc2dc4-da46-11e6-8e50-9b917454a569.gif

I use the Google chrome extension.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Benjol/SE-AutoReviewComments/issues/128, or mute the thread https://github.com/notifications/unsubscribe-auth/AARPAkPeUfpbUWK2vh_XICBQnxAC06Diks5rSO0WgaJpZM4LjqHv .

makyen commented 5 years ago

The reason this is happening is that the request to the SE API fails. The script currently does not send an API key along with it's request to the SE API. This means that it's sharing the 300 total requests from that IP which are permitted per day1 for applications without an API key. If you have other applications which also don't have API keys, then your quota of requests is quite limited.

If an API key is obtained, which is a simple matter of requesting it (use the link above; ignore the OAuth stuff as you don't need it), then the application will share the 10,000 requests/IP/day which are permitted to applications with an API key2.

The owner of the application must make the request for the API key.

While there may be other, additional, reasons that you see this issue happening, running out of API quota due to not having an API key is probably the problem in 95%+ of the cases where this symptom occurs.

I tested this by adding in an API key I use for testing, which resolved the problem.

Change:

url: '//api.stackexchange.com/2.2/users/' + userid + '?site=' + siteurl + '&jsonp=?',

to:

url: '//api.stackexchange.com/2.2/users/' + userid + '?site=' + siteurl + '&key=[This apps SE API key here]' + '&jsonp=?',

  1. "Days" in SE API quota limits are not UTC days. The "day" starts from the first request made to the SE API. The "day" ends 24 hours after that first request. When the next "day" starts depends on when anything from that IP makes a requests (i.e. the next "day" may start 2 hours after the prior "day" ends, if no requests are made to the SE API from that IP in those 2 hours).
  2. The quota is 10,000 requests/IP/day for applications with an API key, but without a user auth-token. This application does not need an auth-token as it is doesn't use private information or write to the API. Applications with both an API key and a user auth-token get a separate 10,000 requests/user/day. There are up to 5 of these separate quotas per user. reference
oliversalzburg commented 5 years ago

@makyen Nice work. Could you provide a PR with an appropriate change for this? @Benjol Would you be able to generate an API key? I could do it, but I think it would be best if everything is in your hands.

Benjol commented 5 years ago

I'll try to find a moment to look into it.

On Fri, 16 Nov 2018 at 11:36, Oliver Salzburg notifications@github.com wrote:

@makyen https://github.com/makyen Nice work. Could you provide a PR with an appropriate change for this? @Benjol https://github.com/Benjol Would you be able to generate an API key? I could do it, but I think it would be best if everything is in your hands.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Benjol/SE-AutoReviewComments/issues/128#issuecomment-439352822, or mute the thread https://github.com/notifications/unsubscribe-auth/AARPAq-_LZIT1IdJdo66A7CJsFOrpApFks5uvpUegaJpZM4LjqHv .

makyen commented 5 years ago

@oliversalzburg While I could provide a PR, I would need the API key which is desired to be used. While it's possible for anyone to get an API key for any random application, the most appropriate thing is for the API key to be obtained by the owner of this application. Once that's obtained, the change is trivial (i.e. just add + '&key=[This apps SE API key here]' to the line I quoted). IMO, it would take more work to transfer the API key to me in order to make the PR, than to just go ahead and make the change.

I'm willing to do a PR, if given the API key, but my doing it feels a bit wasteful.


@Benjol If you want some suggestions as to what to enter into the entry fields, the following might be reasonable. Once created, you can edit to change any of these entries:

Application Name

AutoReviewComments

Description

No more re-typing the same comments over and over!

This script adds a little 'auto' link next to all comments boxes. When you click the link, you see a popup with 6 configurable auto-comments (canned responses), which you can easily click to insert.

OAuth Domain

stackexchange.com/oauth/login_success

This is the example entry which Stack Apps mentions in the help. IIRC, you are not permitted to leave this blank. This value is just a placeholder that you never use, but that Stack Apps requires you enter. If you were actually going to use OAuth, then you would want this something unique to your script. When getting an API key for my first app, this was the entry that resulted in the most research.

Application Website

https://github.com/Benjol/SE-AutoReviewComments

Application Icon (optional)

https://i.stack.imgur.com/bVfJp.png

I uploaded this to SE's imgur from https://raw.githubusercontent.com/Benjol/SE-AutoReviewComments/master/src/icons/icon128.png, which is:

icon

Enable Client Side OAuth Flow

Leave unchecked


After you click on "Register Your Application", you can edit it and add:

Stack Apps Post (optional)

https://stackapps.com/questions/2116/autoreviewcomments-pro-forma-comments-for-se

oliversalzburg commented 5 years ago

@makyen I understand that this seems like the effort is not in relation to the scope of the change, but a lot of the original maintainers of the project have become somewhat detached from it. The best I can do is to help organize efforts and build a new release every once in a while.

makyen commented 5 years ago

@oliversalzburg To be clear: I can get an API key for this, but then it's one that I've created. My understanding is that the strong preference from SE is that it's the owner of the project, usually the person that posts the Stack Apps question, that creates the API key used with a specific app. I'm not sure if my doing so and using it in this project is against policy for the SE API.

I'm not refusing to submit a PR, just that there's information required for the PR that I don't have. That information "should" be generated by someone more in control of the project than I am. Once that information is available, the actual change is trivial. The PR is more complex, as it's necessary to have a build environment set up to generate all the derived files. It's also unclear if the PR is supposed to roll the revision and actually build the whole thing, or wait for one of the maintainers to do that for a release. I didn't see any contributor directions which stated one way or another. But, if you really want me to do the PR, once the API key is obtained, I'm willing to do that.

oliversalzburg commented 5 years ago

@Benjol You think you could help us out with the API key? I think https://stackapps.com/apps/oauth/register is where to set it up.

Benjol commented 5 years ago

I'll try and have a look later today

-----Original Message----- From: "Oliver Salzburg" notifications@github.com Sent: ‎11/‎03/‎2019 01:44 To: "Benjol/SE-AutoReviewComments" SE-AutoReviewComments@noreply.github.com Cc: "Benjol" ben.simkins@gmail.com; "Mention" mention@noreply.github.com Subject: Re: [Benjol/SE-AutoReviewComments] Why does the autocomment windowseem to load forever (moving dots)? (#128)

@Benjol You think you could help us out with the API key? I think https://stackapps.com/apps/oauth/register is where to set it up. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

makyen commented 5 years ago

@Benjol (You may not have read this whole issue thread, or done so a few months ago, so...) My long comment above with the SE Auto logo in it has what I believe you'll probably want as entries for the SE API key request form (or at least responses that are something close). Obviously, they are just suggestions and you should use what you deem best, but having the information collected in one place may save you some time. In my experience, the SE API key is available immediately after submitting the form.

Benjol commented 5 years ago

Resolved in https://github.com/Benjol/SE-AutoReviewComments/commit/e3a0a55277acea371b2e1ee869bcf03c85faffc9, release coming up...

For my future reference, the stack app ID is https://stackapps.com/apps/oauth/view/14612

Benjol commented 5 years ago

OK, my bad, it's not working (for me)...

Benjol commented 5 years ago

OK, I pasted in the Client Secret (now reset) instead of the Key. Blame it on a bad night :)

Fixed in https://github.com/Benjol/SE-AutoReviewComments/commit/19380672a406cdfeb3b726ba06ddf1b5ba6d767d. I'm now going to upload Release files and Chrome extension. Version 1.4.7

To answer your question @makyen, currently I think only @oliversalzburg and I (of those present) can upload Release files, but anyone can build them - the wiki has info on building.

I know @alerque envisioned something a bit more sophisticated in git, where releases and release artifacts were only committed to the master branch, and everything else happened on the dev branch. But currently everything is happening on the master branch, though I try to separate code update commits from version update commits.

The thing to look out for when sending pull requests is that the source file is in src, not in dist.

If anyone wants to be added to the list of people who can take a more active role in maintaining this project, I'm not opposed, though I would also defer to @oliversalzburg's opinion, as he has been a great help over the years. I don't actually use the script myself anymore, as I've taken much more of a passive consumer role to SE in general more recently. Review-queue fatigue :)

(I think I am still the only person with access rights to update the crx in the Chrome Store, but I could also investigate sharing that. And now I am also sole owner of the SE API...)