Commit Graph

5415 Commits

Author SHA1 Message Date
Brian Simpson
cd88707fdb cache: Add timers. 2015-02-17 18:09:20 -05:00
Neil Williams
198e67fe97 Reduce gzip threshold for main caches to 1400 bytes.
The goal here is to reduce network traffic to the main cache nodes.
This will also affect the size of the objects in the cache which could
make things better by fitting more things in cache, or make things worse
by oversubscribing specific slabs. We should watch network traffic on
the cache nodes, hit rates, and eviction rates in the period after
rolling this out. Additionally, this will increase the amount of
gzipping app servers deal with, so response times and CPU should be
monitored as well.

I chose 1400 bytes to be a fudge-factor smaller than the MTU; since the
goal here is network efficiency and not cache memory space, going
smaller than a single packet isn't terribly important.
2015-02-13 17:49:29 -05:00
Brian Simpson
705c4f1992 inventory: Correctly retrieve transactions for freebie campaigns. 2015-02-13 15:04:02 -05:00
John-William Trenholm
9e64e56960 tracker.py: use env var for configuration file
Upstart needs to use a environment variable to determine the
configuration file.
2015-02-12 16:00:04 -08:00
Neil Williams
f94e9cc14e install-reddit: Upgrade Cassandra and use DataStax repos.
This modernizes install-script reddit a bit, as we're already running
1.2 in production.

Note: this upgrades Cassandra from a patched 1.0.7 to vanilla 1.2.19. Please see
http://www.datastax.com/documentation/cassandra/1.2/cassandra/upgrade/upgradeC_c.html
for instructions on upgrading which may require some upgrades of the
data on disk.
2015-02-12 13:27:32 -08:00
Neil Williams
f869f10dbc tdb_sql: Upgrade uses of deprecated last_inserted_ids().
This function gets removed in SQLAlchemy 0.8 in favor of the already
present inserted_primary_key.
2015-02-12 13:27:32 -08:00
Florence Yeun
5712c98f37 Hide inbox notifications for user's own comment and post replies
Fix bug where your own comment and post replies appear in your inbox.
New notifications are no longer generated.  Old notifications will remain.
2015-02-12 11:56:21 -08:00
penn300bb
aa698dd807 Fix uri & extensions of the /duplicates endpoint
The order was backwards.

```
/{article}/duplicates --> /duplicates/{article}
```

Switched the order, and added in the proper extensions.

Referenced in: https://www.reddit.com/r/redditdev/comments/2vbnkt/sample_curl_call_for_articleduplicates/
2015-02-12 13:38:26 -05:00
Brian Simpson
29d3c53369 Query: Use a 7 day ttl for caching. 2015-02-11 14:52:08 -05:00
Brian Simpson
720a99ea70 Thing: Use a 7 day ttl for caching. 2015-02-11 14:52:03 -05:00
powerlanguage
f2ccc78086 Fix long usernames breaking snoovatar link. 2015-02-11 11:38:37 -08:00
powerlanguage
6eb1dbcaf3 Style sidebar snoovatar link. 2015-02-11 11:37:20 -08:00
MelissaCole
2b84cc0439 Add snoovatar link on userpage of those with public snoovatar and gold. 2015-02-11 11:36:59 -08:00
MelissaCole
bb96aad266 Add creddits to purchase price in gold checkout
This will appear as '$3.99 or 1 creddit' if the user making the purchase
already has creddits. This will hopefully reduce confusion about the
ability to purchase gold with creddits.

Suggested by /u/roastedlasagna: https://www.reddit.com/r/ideasfortheadmins/comments/2s7ktf/giving_gold_allow_a_user_to_give_another_user/cnn6jhn
2015-02-11 11:27:02 -08:00
powerlanguage
d012d21f51 Add transparency to goldvertisment graphic. 2015-02-11 11:27:02 -08:00
Brian Simpson
966d9519b1 cache: Log events for retry successes.
This will help us determine if multiple retries are worthwhile.
2015-02-11 00:11:03 -05:00
Ricky Ramirez
46167ecb88 pages: Use a hashed key for commentpane.
The previous method could generate key names with whitespace which don't work
with the memcache ASCII protocol.
2015-02-11 10:31:38 -08:00
umbrae
42ca7212e5 Make restrict_sr on search retain state across page views.
This commit heavily influenced by @samertm's work
in https://github.com/reddit/reddit/pull/1211
2015-02-09 20:58:32 -08:00
Florence Yeun
4030b68c6d Revert "Hide inbox notifications for user's own comment and post replies"
This reverts commit 309dad8e1a.
2015-02-09 16:39:33 -08:00
Brian Simpson
21d3f1258a CachedQuery._prune: calculate newest_prune only if items exist. 2015-02-09 18:03:23 -05:00
Brian Simpson
460c93aca4 CachedQuery: on prune attempt to remove the entire row with a timestamp.
Performing a row delete (even if some columns are left behind due to higher
timestamps) might have better tombstone performance than deleting specific
columns from that row.
2015-02-09 18:03:14 -05:00
Brian Simpson
7f6232e4ce Read from CommentVisitsByUser and stop writing hardcache. 2015-02-09 18:03:01 -05:00
Brian Simpson
fdc2a2cf77 Dual write hardcache and CommentVisitsByUser. 2015-02-09 18:02:49 -05:00
Florence Yeun
309dad8e1a Hide inbox notifications for user's own comment and post replies
Fix bug where your own comment and post replies appear in your inbox.
Notifications are still generated but not displayed.
2015-02-09 14:43:19 -08:00
Florence Yeun
93b904a51c Prevent duplicate inbox messages
Fix bug where sending a message to yourself results in a duplicate inbox message.
2015-02-09 14:43:19 -08:00
xiongchiamiov
f75599579e Thumbnail scraper: handle protocol-relative urls
`urllib2` by default doesn't handle protocol-relative urls, nor can it without
access to the context in which the url was created.  This has been causing
problems with scraping thumbnails from pages where the `og:image` attribute
uses a protocol-relative url, as reported in reddit/reddit#1069 and
[/r/bugs](http://redd.it/2q62g2).

Now we coerce any protocol-relative urls we extract from the page into the same
protocol as the page itself.
2015-02-06 09:13:02 -08:00
xiongchiamiov
8d2a668c5b Utils: add coerce_url_to_protocol()
Sometimes we have a url that may or may not be using the protocol we want.  In
those cases, it's nice to have a handy way to ensure the protocol.
2015-02-06 09:13:01 -08:00
Keith Mitchell
4a9d45a878 API: Add 'archived' attribute to Links & Comments 2015-02-04 16:40:25 -08:00
Keith Mitchell
2b5b10dd23 /dev/api: Stop documenting non-OAuth2 endpoints 2015-02-04 15:50:09 -08:00
Keith Mitchell
18240366df /dev/api: Document additional endpoints
* sticky
* sidebar
* related
* duplicates

Are now lightly documented on /dev/api.
2015-02-04 15:50:01 -08:00
Jordan Milne
436281f88e Fix link generation on oauth.
When on `foo.oauth.reddit.com`, we want to generate links like
`foo.reddit.com`
2015-02-04 11:27:30 -08:00
KeenRivals
d6358c7484 Losslessly reduced PNGs with Optipng and Advancecomp. Only PNGs that were referenced in less files that were not commented as sprites were reduced. 2015-02-03 06:16:59 -08:00
Florence Yeun
817aecef1a Disable voting when page is in read only mode
Voting should not be available when a page is in read only or heavy load mode.
This prevents a blank modal from appearing when voting on a post or comment.
2015-02-03 15:15:28 -08:00
Brian Simpson
36f437a79a Add CommentVisitsByUser model for storing comments page visits. 2015-02-03 05:25:26 -05:00
Brian Simpson
31e9bb434a Clean up comment_visits method. 2015-02-03 05:25:19 -05:00
Jordan Milne
9f4a561489 Consider non-www. reserved subdomains part of the domains prefix
This helps with some cache poisoning where we'd end up with www.
links on beta. and vice versa. This also retains existing behaviour
where something like "en.www." == "en.", "en.en." == "en.", and
"json." == ""
2015-02-03 13:21:26 -08:00
Chad Birch
8fcf4bf699 Mod report reasons: don't try to translate
Seems to have been an accidental call left to _() inside the title of
report reasons made by moderators, which was causing an error.
2015-02-03 14:04:34 -07:00
Jordan Milne
b1dbd3071d Handle allocation failures in C code gracefully
Thanks to Nathanael A. Hoyle for the report! Some of these may have
been exploitable due to pointer arithmetic before reads / writes.
Just bail out if we can't allocate.
2015-02-02 16:07:13 -08:00
Brian Simpson
b2e9903b8d Send user's IP address when creating an authorization hold.
Hopefully this helps trigger some of Authorize.net's fraud detection.
2015-02-02 16:58:29 -05:00
Brian Simpson
8128b5737f CreateCustomerProfileTransactionRequest.__init__: remove dead code. 2015-02-02 16:58:29 -05:00
Brian Simpson
70ea33f302 Delete some authorize.net transaction types we don't use. 2015-02-02 16:58:29 -05:00
Brian Simpson
b3bf278cb3 authorize: Delete unused ShippingAddress stuff. 2015-02-02 16:58:24 -05:00
Matt Lee
0b0872743f selfserve: Fix sponsor domain override .
When the new promo form went from being a normal ajax call to a multipart form, it
stopped using the 'post_pseudo_form' method.  That method ignored inputs with the
'gray' class applied, which was being used for displaying the 'optional' placeholder
string.  This was probably created before there was widespread support for the
placeholder html attribute.
2015-01-30 11:59:31 -08:00
Matt Lee
ad99451f63 markdown: Update markdown styles.
+ Add horizontal padding to gold-highlighted comments
+ Restore blockquote indent
+ Darken blockquote and del element text
+ Darken blockquote border and hr element
+ Increase font size of reply textarea to match comment font size
+ Fix alignment of messages
+ Restore green text to sent modmail
+ Fix code elements having a much smaller font size in Chrome
+ Increase left spacing on lists to prevent ol list numbers from being cropped.
+ Make code blocks have white background when on non-white backgrounds.

Conflicts:
	r2/r2/public/static/css/markdown.less
2015-01-30 11:59:06 -08:00
Brian Simpson
f558033c96 selfserve: Allow thumbnail upload on new_promo page.
Add the POST_create_promo endpoint and validator for posting a multipart form.  The
form is posted to a hidden iframe on the page, which then relays the jquery response
back to the parent frame.
2015-01-30 11:57:21 -08:00
Brian Simpson
4db92f5b73 promotecontroller: clean up POST_link_thumb. 2015-01-30 11:57:20 -08:00
Matt Lee
3fca431e3c markdown: Swap feature flags to enable access to old markdown styles. 2015-01-30 11:56:38 -08:00
Matt Lee
29df0ad506 selfserve: Return to first page when changing sort on sponsor/promoted/ listing.
Currently, if you navigate to the second page of links then change the sort type, you'll
get no results back.  This is because it is carrying over the 'after' query param.  This
drops the query params for all of the sort options _except_ the one you are currently
on, so that changing it will always kick you back to page 1.
2015-01-30 11:55:56 -08:00
Matt Lee
04363d781a selfserve: Change 'bid' to 'spend' on edit_promo page.
from Dylan:

We haven't used "bids" for 18 months or so, can probably substitute "Spend History" and
"Spend" in place of the two instances of bid. Doesn't really matter for people that are
familiar with the system, but as we bring new people on it may be confusing.
2015-01-30 11:55:40 -08:00
Matt Lee
8e654fbb89 Add es5-sham to reddit-init-legacy.
es5-shim only adds polyfills for es5 methods whose behavior can be faithfully
emulated in legacy javascript engines.  es5-sham adds stubs and partial support
for additional es5 methods (e.g. Object.freeze) with the goal of preventing
runtime errors.

react-with-addons.js uses some of these methods, and as such breaks on old IE.
The 'shams' work perfectly fine for it.
2015-01-30 11:55:00 -08:00