mypy version 0.700 includes some stubs for the bleach library, but
they're not correct and cause errors when run on the Tildes codebase.
I've left a comment on the typeshed repo here, so hopefully it will be
resolved before long:
https://github.com/python/typeshed/pull/2709#issuecomment-483120729
I'll pin mypy's version to the previous version of 0.670 for now to
avoid this, but if the stubs aren't fixed for a while I may need to do
it differently.
Starting with psycopg2 version 2.8, the package on pypi no longer
contains a binary version and must be compiled from source. These two
packages are required for this to be possible.
It would have been simpler to just switch to the psycopg2-binary
package, however that isn't a very good solution overall since many
other packages treat "psycopg2" as the dependency that they want
installed, not "psycopg2-binary". Overall, this situation is pretty
messy and I'm not sure what will end up being the final state, but this
should work for now.
More info about the source-only change:
http://initd.org/psycopg/articles/2018/02/08/psycopg-274-released/
The UPDATE query that marks notifications read due to interaction was
causing a flush, so if the user repeated an interaction (such as trying
to vote again on a comment they had already voted on), the autoflush
would cause an IntegrityError when it tried to re-insert the vote.
This moves the UPDATE into a block with autoflush disabled, and also
just moves the interaction-marking into its own function instead of
having so many duplications of its logic.
A few minor interface improvements for topic tag filters - mostly just
changing to the settings page defining them in a textarea, with one per
line. Previously this was just a text input with the tags
comma-separated, which got unwieldy very quickly.
This reduces the size and spacing of some of the elements of a topic in
topic listings on small screens, and should make information display
better overall.
These buttons were basically icons, and it's better to have them with
text labels like this. Their left border was also disappearing at
smaller screen sizes due to re-using the .btn-comment-collapse style, so
it's better to do a separate style for "light buttons" like this, and
keep that behavior specifically to the actual comment collapse buttons.
When someone posts a new topic, this will automatically remove any tag
that matches the group name. So for example, if the topic is being
posted in ~music, a tag of "music" will be removed.
If there turns out to be some edge case where this is important, it can
be re-added through the tag editing interface, since this only applies
when posting a new topic.
When a user interacts with a comment (by voting, replying, labeling, or
bookmarking), any unread notifications they have from that comment will
now be marked as read.
This behavior is on by default, but can be disabled in Settings if the
user would rather mark all notifications read manually.
Unfortunately, right now Chrome only supports "pixelated", and Firefox
only supports "crisp-edges", so this should give the best result across
browsers.
This updates the clean_private_data script to delete more data
associated with users that deleted their accounts at least 30 days ago,
including all of their votes, subscriptions, bookmarks, and
notifications.
Due to hiding the overflow on topic sources to deal with longer domain
names, descenders (in 'y', 'g', 'j', etc.) were being hidden if they
went outside of the box. This increases the line-height and removes the
top margin - the result should be almost exactly the same, but won't cut
off the descenders.
This increases the touch size of the nav links, gives them a bit more
spacing on desktop, and center-aligns the header items vertically, which
looks better when they wrap (but that's still pretty bad overall).
This looked a bit off because the comment always has its own left
border, so the border was 1px thicker next to the button (and sometimes
a different color).
Previously, this was set as "same-origin" which will only send a
referrer to Tildes itself. This changes so that it will continue sending
the full referrer to Tildes, but will send only the domain to external
sites if they use HTTPS (and no referer to HTTP ones).
This can be useful because there are often situations where an article
author sees traffic coming from a site and will come to check it out and
be able to participate in the discussion.
This was a little more strict before and would only skip linkification
if the entire path was digits and/or periods. However, I've seen it
still hitting some people if they write things like "~100k". It's very
unlikely that we're ever going to have a top-level group with a name
starting with a number, so let's just skip linkification for all
instances where a number is the first thing.
Previously, the site's main content would be pushed down a little when
you have new comment notifications or messages. This moves them to the
left of the username instead, and uses a different flexbox arrangement
inside the sidebar when it's collapsed on smaller screens.
Using bootstrap() seems to cause issues with re-declaring the Prometheus
metrics (which happens in the tweens that we don't really need or want
anyway). There might be better ways to do this including not attaching
the tweens for scripts, but this seems to work fine (and was already
being done this way in the YouTube API consumer).
This is a bit ugly (and probably the wrong spot to do it), but we need
to wipe the old metadata before adding in new stuff from the
re-scrape(s). Otherwise, if we do something like change a YouTube video
to an article, the duration of the video will still be left in the
metadata even though it's no longer relevant.
This was only being done when a new topic was created before, which
meant that if a topic's link was edited, the new link wouldn't go
through the transformation process (and we do want it to).
I was seeing some strange behavior from this tween on non-GET requests,
where a huge number of Set-Cookie headers were being added. I'm not sure
exactly what was causing this, but it's not necessary to do on non-GET
requests anyway, so this should be safer.