Commit Graph

5221 Commits

Author SHA1 Message Date
Brian Simpson
136fa5a359 Fail cleanly when VSrCanBan called on non Link, Comment, or Message. 2014-12-16 03:13:55 -05:00
MelissaCole
2f79fe8040 Change remaining creddits label to "use # of your # creddits" 2014-12-16 11:55:43 -08:00
Brian Simpson
dffa944959 MultiReddit path with 'all' or 'friends' becomes AllSR or FriendsSR.
This restores the old behavior.
2014-12-16 00:10:15 -05:00
Jordan Milne
cde43e88a3 Make /api/morechildren and /api/expando into GET endpoints
They don't actually modify anything, and this way they'll benefit
from the CDN's caching layer.
2014-12-15 19:05:28 -04:00
Jordan Milne
50d047c13c Don't place error pages in the pagecache 2014-12-15 19:05:09 -04:00
Jordan Milne
ab6058e2a1 Fix attempting two pagecache reads in one request
`c` gets clobbered when transitioning between controllers, so anything
that needs to survive that must be in `request.environ` instead.
2014-12-15 19:04:41 -04:00
Robert Ditthardt
c79a3bde17 lock.py: Made lock exception check for success
In certain cases, memcached add will except even though it actually
succeeds. This would cause a lock to wait forever, or timeout.
2014-12-15 13:56:40 -08:00
Robert Ditthardt
aaa399bd96 lock.py: Add random delay between lock retries.
This should reduce memcached spam and burst requests when locks are highly contended.
2014-12-15 13:56:36 -08:00
Robert Ditthardt
aacdded178 Log when locks expire before they can be released
The purpose of these changes is to verify that a situation is not occurring.
Currently, a situation could theoretically arise where a lock expires for
one thread, a new thread gets a new lock on the same key, and the old thread
then completes. The out of order deletion of the lock would cause a cascade
effect, and the lock would then be entirely ineffective for all threads
until there is no contention on the lock anymore for the expiration period.
Presently, if this situation occurs it does so silently since no error would be
thrown.
2014-12-15 13:56:32 -08:00
Neil Williams
05a1e3314a log_q: operational_exceptions += MemcachedMaximumRetryException.
Since caches are used all over the place, there are plenty of different
stack traces that can throw this exception. This prevents us from
getting hundreds of emailed exception reports when a cache server goes
down.
2014-12-15 13:30:49 -08:00
Neil Williams
67173937db *VoteDetailsByDay: Page through votes to avoid timeouts when counting.
Since the number of votes is usually in the tens of millions currently,
get_count turned out to take far too long for reasonable RPC timeouts.
Instead of just boosting the timeout, this uses xget to page through the
columns instead and just counts them manually client side.
Unfortunately this is harder on C* and the network, but since we're only
using this in the awards stats job which runs daily it should be OK.
2014-12-15 13:30:46 -08:00
Ben Edelman
f2cbd934e4 Fixed two typos
Both typos were in comments:
"parameters" was misspelled as "paramters" and
"disentangle" was misspelled as "disentagle"
2014-12-15 12:28:02 -08:00
Brian Simpson
d0c51be3f4 Traffic processing: Switch from m1.xlarge to m3.xlarge.
The new instance type is faster and cheaper.
2014-12-13 12:11:00 -05:00
Brian Simpson
d54c78daa0 Filter out bad Subreddit names from MultiReddit.
Previous method was letting non-ascii characters through in the
MultiReddit.path which caused issues in other areas.
2014-12-13 12:10:54 -05:00
Brian Simpson
0b6b3cd787 Stop converting multis with friends or all to special subreddits. 2014-12-13 12:10:49 -05:00
Brian Simpson
fd781d4d85 Message.add_props: _force_unicode body when adding warning.
This was causing UnicodeDecodeErrors.
2014-12-13 12:10:42 -05:00
Brian Simpson
00e03edbfd Traffic processing: Validate clicks by checking response code.
Double checking in the click app and in the processing scripts was
difficult. Just trust the click app and assume any request that got
a 302 response is valid.
2014-12-12 17:00:29 -05:00
powerlanguage
5e06e44c6e Fix typo and add username request. 2014-12-11 13:40:07 -08:00
Brian Simpson
d2dbe851a0 Distinguish admin receivers in modmail. 2014-12-11 15:12:32 -05:00
Brian Simpson
81b5ebbbce Distinguish mod receiver in modmail.
Previously the receiving user's name was just black text. The recent
change to link the name to the profile page made regular users and
mods look too similar, causing confusion.
2014-12-11 15:12:27 -05:00
Keith Mitchell
b1320c2fc2 Skip CORS in RedditController.post if it's already checked 2014-12-10 13:59:57 -08:00
Keith Mitchell
23b2f78e85 Don't auth for OPTIONS requests on Oauth-only controllers 2014-12-10 13:59:50 -08:00
Keith Mitchell
f1c277cde8 CORS: Update CORS headers for OAuth2 access 2014-12-10 13:59:43 -08:00
Keith Mitchell
92b9fc9c73 OAuth2: Implement implicit grants 2014-12-10 13:59:29 -08:00
Chris Dary
84d39cecf5 Gold checkout: Fix mismerge to reddit/reddit.
An extra branch got added here that was incorrect.
2014-12-10 13:48:20 -08:00
Jordan Milne
add5b0ed83 Store statistics on pagecache hits / misses by endpoint
This way we can tell which endpoints are useful to cache, and which
ones are just needlessly forcing other stuff out of the cache.
2014-12-10 13:48:20 -08:00
Jordan Milne
d877ec0751 Fix a malformed inherit tag in linkinfopage.htmllite 2014-12-10 13:48:20 -08:00
Robert Ditthardt
6ad89f49b2 Memcached: Remove retry extra logging and feature flag 2014-12-10 13:48:20 -08:00
Roger Ostrander
1d4bf69bd9 VoteDetails: Backfill IP addresses for votes < 90 days old 2014-12-10 13:48:20 -08:00
Robert Ditthardt
6a8ea7d51c Make feature flags less reliant on pylons 2014-12-10 13:09:19 -08:00
Robert Ditthardt
d6a74a0164 Memcached: Implement retry on failure. 2014-12-10 13:09:19 -08:00
Brian Simpson
19c269a14c Let sponsors lookup users by fullname. 2014-12-10 13:09:19 -08:00
David Wick
be92a6f897 Make advertising rules open in new tab 2014-12-10 13:09:19 -08:00
Brian Simpson
af04006baf click: unquote destination before unmangling query string. 2014-12-10 13:09:19 -08:00
Brian Simpson
966bb14675 Click redirect: fix encoding of destination url.
Some advertisers set their ad's url to an intermediate tracker so
they can independently track clicks. This results in a series of
redirects like this:

reddit tracker > intermediate tracker > final destination

The ad's url is communicated to the reddit tracker through a query
parameter which is urlencoded on reddit.com and then unquoted when
being handled by the reddit tracker. This unquoting causes problems
if there is an intermediate tracker with its own query string
that needs to be urlencoded. This commit adds handling for those query
strings.
2014-12-10 13:09:18 -08:00
Robert Ditthardt
7540117113 Stop negative thing id from reaching the database.
This is extra safety against a bug we can't reproduce anymore where
postgres would hang when very large thing ids were used in queries.
2014-12-10 13:09:18 -08:00
David Wick
63f9c31887 Add autocomplete to multis 2014-12-10 13:09:18 -08:00
Keith Mitchell
543e5a6998 OAuth: Use reasonable max length for device_id 2014-12-10 13:09:18 -08:00
Keith Mitchell
c3ef951879 Add TOO_SHORT / min_length to VLength 2014-12-10 13:09:18 -08:00
Keith Mitchell
63dd2f0c94 OAuth2: Add extension grant for app-only auth
Grant URI: https://oauth.reddit.com/grants/installed_client

This minor extension grant allows non-confidential
OAuth2 clients to request user-less OAuth2 tokens.

Consumers should provide a unique ID, and re-use that ID
for subsequent token requests from the same device. ID
generation is left up to the client.

This is separate from client_credentials so that the
client_credentials grant can conform to the official spec.
2014-12-10 13:09:18 -08:00
umbrae
9c50a08c65 Fix logo href in button embeds to be absolute.
Thanks to @ohmanger in https://github.com/reddit/reddit/pull/1151
2014-12-10 13:09:18 -08:00
umbrae
18bc7ceb7b Load button info with JSONP to avoid CORS HTTPS errors 2014-12-10 13:09:18 -08:00
umbrae
8a0aa2e977 Inbox counts: Only unnotify on comments 2014-12-10 13:09:18 -08:00
umbrae
36691515e8 Update readme for short blurb on contributing 2014-12-10 13:09:18 -08:00
Brian Simpson
9532e12a51 PromoteLinkForm: don't preload any inventory data. 2014-12-10 13:09:18 -08:00
Chad Birch
bea0fdd936 Revert "temp commit - fallback for renamed payment_blob key" 2014-12-10 13:09:18 -08:00
Jason Harvey
de5b9239a6 Revert "Use lang_override for all "en" variants."
Provide an escape from pirate day.

This reverts commit cc3af6e8ff.
2014-12-10 13:09:18 -08:00
Keith Mitchell
90ba5db9f6 OAuth2: Access Token defaults should be strings
The string u'None' was getting saved for some defaults.
2014-12-10 13:09:18 -08:00
Keith Mitchell
91f2fd5d46 OAuth2: Don't make installed apps use secrets
Installed apps are considered "public" as part of the
OAuth2 spec (unable to keep a secret). Don't
show a secret for such apps on the /prefs/apps page,
and don't check the secret as part of client identification
for such apps.
2014-12-10 13:09:18 -08:00
Keith Mitchell
38e2996f7e Docs: Minor update to POST_access_token docstring 2014-12-10 13:09:18 -08:00