For usability, keyboard focus is put into the first element of the "send
email/PM" form when it's shown after clicking the "share via email" or
"share via PM" buttons on the share widget.
Redditors can use the share widget to share a post/comment via reddit PM
by inputting their username into the "share to [email1, email2, ...]"
field on the "share via email" form. This PR makes this more obvious to
users by providing a "share via reddit pm" to the widget which changes
the form text from "send email to name1@example.com..." to "send PM to
username".
PermalinkCommentOrderer will walk up the comment tree if context is
requested (i.e. context=2 means show the two ancestors of the requested
comment). If an ancestor comment is missing from the tree we will now
fail cleanly and fall back to the regular CommentOrderer.
This situation can arise when there are multiple commentstree_q consumers,
causing a child comment to be added to the comment tree before its parent.
These classes are like LiveList (and use LiveList internally) but
they also store and watch a copy of the reduced data. This is useful
for cases where the map/reduce phase is slow and CPU intensive.
By storing the reduced data separately the map/reduce only needs
to be done by the process that's updating the list. All other processes
watch the reduced data node.
NOTE: we were using the old key to get a lock on updating the
memoized result, but will now use the new key to get the lock. This
means that during the deploy we can have multiple processes updating
the memoized result. This is inefficient but should be fine.
The note on the registration page is stored in the wiki and is fronted
by memoizecache because it is loaded very frequently (it's on the login
page). Stale the cache lookup to reduce the number of requests that
fall through to memoizecache. It's currently requested ~1600/s.
Adding them to the tree doesn't hurt anything--they still won't be
displayed until their parent comment is in the tree, but it does allow
for easier cleanup in case comments get processed out of order. Once their
parent is added to the tree everything will be consistent and fine.
The CommentTree is updated first, then it is read within write_comment_orders.
There's no issue of eventual consistency so the read will always get the
most up to date version of the CommentTree.
_rel_cache is used to store (t1, t2, name) --> rel_id to make
Relation._fast_query work without falling through to a postgres
query. Reducing the TTL will let us recover from inconsistencies
more quickly, but we'll have to watch to make sure the more frequent
expirations don't put too much pressure on postgres.
In the case of cache outages the values in cache can become out of
sync with reality. If a subreddit is created during an outage it will
be impossible to access it with Subreddit._by_name until the cache is
corrected. Setting a TTL will ensure this happens eventually.
Plugins must meet the following requirements in order to be installed
on a Vagrant build:
1. Be listed in `plugins` in the Vagrantfile
2. Be cloned to the designated install directory
3. Adhere to plugin naming conventions
This applies to all open-source plugins.
This reverts commit 32dece6abec82be66d034905720203da6ee12bf7.
I had an incorrect assumption that the number of updates to permacache
significantly contributes to the instability we were having with cassandra.
Other changes to comment tree processing have made cassandra more stable so
all this does is slow down updates unnecessarily.
This check is related to the code for the upcoming "User Promoted Posts"
(see https://redd.it/4upf11), which hasn't been open-sourced yet. So
this attr doesn't exist yet, and isn't working. This should be removed
for now but can be added back in when the rest of the code is
open-sourced.
GET_flairlisting sets `USER_DOESNT_EXIST` error if the chosen user is nonexistent, however it's not rendering due to FlairPane checking for a `('USER_DOESNT_EXIST', 'name')` error by mistake. This commit resolves the issue.
add_comments is the consumer for commentstree_q and processed batches of
comments from multiple links. Previously on encountering an
InconsistentCommentTreeError we would return immediately and not process
the rest of the comments in the batch. This created additional inconsistent
CommentTrees.
This will allow us to disable tracking karma for certain accounts
(specifically AutoModerator) to prevent the size of their Account
object from ballooning due to a huge number of karma attributes.
This changes "link karma" to "post karma" in user-visible places:
* The sidebar on user profile pages
* The tooltip for hovering over the number in the header
* The check name in AutoModerator (but adds an alias for "link_karma" so
old rules will continue to work)
This commit starts giving and tracking karma for self-posts as well as
link posts. The karma is stored separately internally, but displayed and
otherwise treated as part of link karma. This will allow us to easily
revert this change and go back to the original link-only karma values if
desired.