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

SOUP beta site detection is broken and should be replaced with a privileges API query #37

Open
vyznev opened this issue Jun 7, 2018 · 0 comments

Comments

@vyznev
Copy link
Owner

vyznev commented Jun 7, 2018

It appears that the CSS-sniffing hack used to set the SOUP.isBeta flag (which in turn is user to determine the rep threshold for various privileges) does not work (at least) on Chrome 67, causing the flag to always be false.

Fortunately, the only fix currently (as of SOUP v1.52) using this flag is mse115702. Thus, the only visible effect of this breakage is that delete links may not appear when they should when downvoting an answer to -1 on a beta site for users with at least 4k but less than 20k rep.

In any case, with the advent of design-independent graduation, the whole idea of this flag has become fundamentally misguided. The proper fix would be to replace it with an SE API user privileges query. The tricky part here is that we want to minimize the number of API queries made, which implies at least heavy caching of the results (e.g. in LocalStorage) and probably also on-demand fetching (with its attendant asynchronous complications).

The API query implementation from the Bounty Bar user script could presumably be used as a basis for this. It's rather bare-bones, but it seems to work well enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant