You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/app
Daniel Sockwell 8758221e73
Fix frontend crash when deleting announcements (#13283)
This two-line change fixes a crash in the front end that occurred
under the following circumstances:
 *  A server had more than one announcement,
 *  A user was displaying the announcements, and
 *  An announcement was deleted (or unpublished, which amounts to
    the same thing.)

As might be expected, the bug was caused by attempting to access a
notification using an index value outside the bounds of the existing
announcements.  Specifically, in two places.  First,
`_markAnnouncementAsRead` attempts to modify announcements based on
the current index.  This is what caused the front end crash.  Second,
when rendering the `Announcements` component, the code paginates the
announcements and displays the current one.  This did not cause a
crash, but caused the front end to confusingly display a blank
announcement (in situations that would have caused a crash) with no
way for the user to navigate back to previous announcements.

This commit fixes both issues by adding a check to ensure that the
code never attempts to access an announcement with an index greater
than or equal to the number of announcements present.
5 years ago
..
chewy Fix needlessly indexing unsearchable statuses into ElasticSearch (#12041) 5 years ago
controllers Add option to include resolved DNS records when blacklisting e-mail domains in admin UI (#13254) 5 years ago
helpers Add ability to delete files uploaded for settings in admin UI (#13192) 5 years ago
javascript Fix frontend crash when deleting announcements (#13283) 5 years ago
lib Bump cld3 from 3.2.6 to 3.3.0 (#13107) 5 years ago
mailers Fix error when sending moderation notification (#13014) 5 years ago
models Fix reported accounts not being whitelisted when resolving a spamcheck report (#13289) 5 years ago
policies Add ability to delete files uploaded for settings in admin UI (#13192) 5 years ago
presenters Fix n+1 query for bookmarks on statuses (#12494) 5 years ago
serializers Change local media attachments to perform heavy processing asynchronously (#13210) 5 years ago
services Fix some timeouts when searching URLs by limiting some database queries (#13253) 5 years ago
validators Search account domain in lowercase (#13016) 5 years ago
views Add option to include resolved DNS records when blacklisting e-mail domains in admin UI (#13254) 5 years ago
workers Change local media attachments to perform heavy processing asynchronously (#13210) 5 years ago