* add global `g.enable_loggedout_experiments`
* The new syntax available is `{"experiment": { "loggedout": true, ... }}`
* Unify the code path to get whether the experiment is enabled with the one to get the experiment variant.
* add additional test cases to `experiment_test.py` and organize `loid` mocking there.
* Fixup mocking in `feature_test.py`
*NOTE*: this is a first pass, and still won't work:
1. on cached pages if we turn the CDN back on
2. on the *first* page impression by a user before they get a loid (though this case is handled).
We've long wanted the ability to run A/B tests; they make it much easier to
test out potential behavior, and reduce the self-selection bias you get through
opt-in betas. This commit adds A/B-type experiment support to the feature
flagging system.
Currently, only server-side checks and tests on logged-out users are directly
supported. This is purely to scope down the feature enough to make it easier
to get a v1 out.
Normally, if a moderator leaves a top-level comment on a post and
distinguishes it, we send an orangered to the author of the post even if
they have "send replies to my inbox" disabled for that post. This is
done since a distinguished top-level comment is often used to give important
information to the author (such as why the post was removed).
However, since AutoMod distinguishes its comments "directly" by just
setting the attribute, this logic wasn't being checked for its comments,
and it hasn't been sending orangereds in cases where it should be. This
commit fixes that, and ensures that it'll always send one whenever it's
commenting on a post.
If a comment gets distinguished and hasn't already been sent to the
parent's author's inbox (due to them having replies disabled), we send a
notification. This is so that users see if a moderator leaves a comment
in reply to one of their posts (often as a reason for removing it).
However, when doing this, we were previously calling queries.new_comment
to send the notification. There are multiple other unnecessary updates
done by this, which can result in strange errors like the comment
showing up twice in the subreddit's comments listing.
This commit changes to just call queries.update_comment_notifications
directly, since that's the only step in new_comment that we actually
needed to be doing.
This moves the creation of a CachedQueryMutator inside
update_comment_notifications, to simplify the process of calling it
directly.
Related to that, the CachedQueryMutator inside new_comment is
now only created when it's needed in the (rare) spam-related cases,
since it no longer needs to create one to be able to call
update_comment_notifications.
If an image is more than 2x taller than wide, we crop it down to a 2x
ratio when generating the image previews. However, the calculation of
the different preview resolutions wasn't accounting for this maximum,
and was still using the original ratio. Because of this, for tall
images, the reported preview heights were incorrect.
The comment order will be computed and stored in permacache when
a comment is added or a comment is voted on. Then when the link's
comment listing is viewed it can be read from permacache.
get_comment_scores expects scores to exist for all comments present
in the CommentTree. To ensure this is true, write the scores before
writing the CommentTree.
Redirecting to the client's `redirect_uri` for any error was an
open redirect. Only redirecting as a result of user action ensures
we're checking errors and only sending a resource owner to a new
page if they've seen the authorize page and have taken some action.
Thanks to /u/avlidienbrunn for reporting!
The interactive debugger was previously generating HTTP URLs even when
on HTTPS. This is because it uses wsgi.url_scheme to determine which
scheme to use when generating URLs and because we're using the paste
server in development, this environment variable was not being set
appropriately. PasteDeploy's PrefixMiddleware will set the variable
correctly based on X-Forwarded-Scheme / X-Forwarded-Proto which we
were already sending from haproxy.
Trophy objects can be fully deleted from postgres.
Trophy ids are also cached per user. If a Trophy is deleted without
updating the cached list of ids, it will raise a NotFound when
looked up later, unless we set ignore_missing=True.
* The constructor for `SSTableSimpleUnsortedWriter` changed
* `sstableloader` changed its directory structure. Now we just don't manage it at all in `tuples_to_sstables` and make the caller do the work
tdb_cassandra requires you to tell it what columns are of what type. We support
a few of them, including `pickle`. This patch adds support for JSON types as
well, which will be much friendlier to multiple tools working with this data
`<updated>` is a required element of `<feed>`
(https://tools.ietf.org/html/rfc4287#section-4.1.1). There's not really a
sensical timestamp for us to put in there because most listings are changed
pretty constantly, so I just put in the timestamp that the feed was last
rendered.
This page works by just doing a search for the title of the post. The
results are almost always completely useless. It's also hit extremely
heavily by search engine bots and is probably costing us a significant
amount of money doing all of these searches.