Skip to content

Commit

Permalink
Merge remote-tracking branch 'parent/releases/v4.2.1' into kb-draft-5…
Browse files Browse the repository at this point in the history
….3-lts
  • Loading branch information
kmycode committed Oct 6, 2023
2 parents e578a4e + 2e33520 commit c14420e
Show file tree
Hide file tree
Showing 27 changed files with 737 additions and 663 deletions.
4 changes: 0 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,6 @@ RSpec/MultipleMemoizedHelpers:
RSpec/NestedGroups:
Max: 6

RSpec/PendingWithoutReason:
Exclude:
- 'spec/models/account_spec.rb'

# This cop supports unsafe autocorrection (--autocorrect-all).
Rails/ApplicationController:
Exclude:
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ All notable changes to this project will be documented in this file.

### Fixed

- Fix some remote posts getting truncated ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27307))
- Fix some cases of infinite scroll code trying to fetch inaccessible posts in a loop ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27286))
- Fix `Vary` headers not being set on some redirects ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27272))
- Fix mentions being matched in some URL query strings ([mjankowski](https://github.com/mastodon/mastodon/pull/25656))
- Fix unexpected linebreak in version string in the Web UI ([vmstan](https://github.com/mastodon/mastodon/pull/26986))
- Fix double scroll bars in some columns in advanced interface ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27187))
- Fix boosts of local users being filtered in account timelines ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27204))
Expand All @@ -32,7 +36,7 @@ All notable changes to this project will be documented in this file.
- Fix retention dashboard not displaying correct month ([vmstan](https://github.com/mastodon/mastodon/pull/27180))
- Fix tIME chunk not being properly removed from PNG uploads ([TheEssem](https://github.com/mastodon/mastodon/pull/27111))
- Fix division by zero in video in bitrate computation code ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27129))
- Fix inefficient queries in “Follows and followers” as well as several admin pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27116))
- Fix inefficient queries in “Follows and followers” as well as several admin pages ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27116), [ClearlyClaire](https://github.com/mastodon/mastodon/pull/27306))
- Fix ActiveRecord using two connection pools when no replica is defined ([ClearlyClaire](https://github.com/mastodon/mastodon/pull/27061))
- Fix the search documentation URL in system checks ([renchap](https://github.com/mastodon/mastodon/pull/27036))

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ GEM
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
sidekiq (6.5.9)
sidekiq (6.5.10)
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
Expand Down
10 changes: 6 additions & 4 deletions app/controllers/concerns/web_app_controller_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ module WebAppControllerConcern
extend ActiveSupport::Concern

included do
prepend_before_action :redirect_unauthenticated_to_permalinks!
before_action :set_app_body_class

vary_by 'Accept, Accept-Language, Cookie'

before_action :redirect_unauthenticated_to_permalinks!
before_action :set_app_body_class
end

def skip_csrf_meta_tags?
Expand All @@ -22,7 +22,9 @@ def redirect_unauthenticated_to_permalinks!
return if user_signed_in? && current_account.moved_to_account_id.nil?

redirect_path = PermalinkRedirector.new(request.path).redirect_path
return if redirect_path.blank?

redirect_to(redirect_path) if redirect_path.present?
expires_in(15.seconds, public: true, stale_while_revalidate: 30.seconds, stale_if_error: 1.day) unless user_signed_in?
redirect_to(redirect_path)
end
end
1 change: 0 additions & 1 deletion app/controllers/follower_accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class FollowerAccountsController < ApplicationController
include AccountControllerConcern
include SignatureVerification
include WebAppControllerConcern

vary_by -> { public_fetch_mode? ? 'Accept, Accept-Language, Cookie' : 'Accept, Accept-Language, Cookie, Signature' }

Expand Down
1 change: 0 additions & 1 deletion app/controllers/following_accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class FollowingAccountsController < ApplicationController
include AccountControllerConcern
include SignatureVerification
include WebAppControllerConcern

vary_by -> { public_fetch_mode? ? 'Accept, Accept-Language, Cookie' : 'Accept, Accept-Language, Cookie, Signature' }

Expand Down
15 changes: 15 additions & 0 deletions app/javascript/mastodon/components/__tests__/hashtag_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,21 @@ describe('computeHashtagBarForStatus', () => {
);
});

it('does not truncate the contents when the last child is a text node', () => {
const status = createStatus(
'this is a #<a class="zrl" href="https://example.com/search?tag=test">test</a>. Some more text',
['test'],
);

const { hashtagsInBar, statusContentProps } =
computeHashtagBarForStatus(status);

expect(hashtagsInBar).toEqual([]);
expect(statusContentProps.statusContent).toMatchInlineSnapshot(
`"this is a #<a class="zrl" href="https://example.com/search?tag=test">test</a>. Some more text"`,
);
});

it('extract tags from the last line', () => {
const status = createStatus(
'<p>Simple text</p><p><a href="test">#hashtag</a></p>',
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/hashtag_bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export function computeHashtagBarForStatus(status: StatusLike): {

const lastChild = template.content.lastChild;

if (!lastChild) return defaultResult;
if (!lastChild || lastChild.nodeType === Node.TEXT_NODE) return defaultResult;

template.content.removeChild(lastChild);
const contentWithoutLastLine = template;
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/components/scrollable_list.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ScrollableList extends PureComponent {
const clientHeight = this.getClientHeight();
const offset = scrollHeight - scrollTop - clientHeight;

if (400 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) {
if (scrollTop > 0 && offset < 400 && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) {
this.props.onLoadMore();
}

Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/locales/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@
"conversation.open": "কথপোকথন দেখান",
"conversation.with": "{names} এর সঙ্গে",
"copypaste.copied": "অনুলিপিকৃত",
"copypaste.copy_to_clipboard": "ক্লিপবোর্ডে কপি করুন",
"directory.federated": "পরিচিত ফেডিভারসের থেকে",
"directory.local": "শুধু {domain} থেকে",
"directory.new_arrivals": "নতুন আগত",
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@
"timeline_hint.resources.followers": "Seuraajat",
"timeline_hint.resources.follows": "seurattua",
"timeline_hint.resources.statuses": "Vanhemmat julkaisut",
"trends.counter_by_accounts": "{count, plural, one {{counter} henkilö} other {{counter} henkilöä}} viimeisten {days, plural, one {päivän} other {{days} päivän}}",
"trends.counter_by_accounts": "{count, plural, one {{counter} henkilö} other {{counter} henkilöä}} {days, plural, one {viimeisen päivän} other {viimeisten {days} päivän}} aikana",
"trends.trending_now": "Suosittua nyt",
"ui.beforeunload": "Luonnos häviää, jos poistut Mastodonista.",
"units.short.billion": "{count} mrd.",
Expand Down
52 changes: 26 additions & 26 deletions app/javascript/mastodon/locales/lv.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@
"compose_form.spoiler.unmarked": "Pievienot satura brīdinājumu",
"compose_form.spoiler_placeholder": "Ieraksti savu brīdinājumu šeit",
"confirmation_modal.cancel": "Atcelt",
"confirmations.block.block_and_report": "Bloķēt un Ziņot",
"confirmations.block.block_and_report": "Bloķēt un ziņot",
"confirmations.block.confirm": "Bloķēt",
"confirmations.block.message": "Vai tiešām vēlies bloķēt {name}?",
"confirmations.cancel_follow_request.confirm": "Atsaukt pieprasījumu",
"confirmations.cancel_follow_request.message": "Vai tiešām vēlies atsaukt pieprasījumu sekot {name}?",
"confirmations.delete.confirm": "Dzēst",
"confirmations.delete.message": "Vai tiešām vēlies dzēst šo ziņu?",
"confirmations.delete.message": "Vai tiešām vēlies dzēst šo ierakstu?",
"confirmations.delete_list.confirm": "Dzēst",
"confirmations.delete_list.message": "Vai tiešam vēlies neatgriezeniski dzēst šo sarakstu?",
"confirmations.discard_edit_media.confirm": "Atmest",
Expand Down Expand Up @@ -309,11 +309,11 @@
"home.column_settings.show_replies": "Rādīt atbildes",
"home.explore_prompt.body": "Tavā mājas plūsmā būs dažādu ziņu sajaukums no atsaucēm, kurām esi izvēlējies sekot, personām, kurām esi izvēlējies sekot, un ziņām, kuras tās izceļ. Ja tas šķiet pārāk kluss, iespējams, vēlēsies:",
"home.explore_prompt.title": "Šī ir tava Mastodon mājvieta.",
"home.hide_announcements": "Slēpt anonsus",
"home.hide_announcements": "Slēpt paziņojumus",
"home.pending_critical_update.body": "Lūdzu, pēc iespējas ātrāk atjaunini savu Mastodon serveri!",
"home.pending_critical_update.link": "Skatīt jauninājumus",
"home.pending_critical_update.title": "Pieejams kritisks drošības jauninājums!",
"home.show_announcements": "Rādīt anonsus",
"home.show_announcements": "Rādīt paziņojumus",
"interaction_modal.description.favourite": "Ar Mastodon kontu tu vari pievienot šo ziņu izlasei, lai informētu autoru, ka to novērtē, un saglabātu to vēlākai lasīšanai.",
"interaction_modal.description.follow": "Ar Mastodon kontu tu vari sekot {name}, lai saņemtu viņu ziņas savā mājas plūsmā.",
"interaction_modal.description.reblog": "Izmantojot kontu Mastodon, tu vari izcelt šo ziņu, lai kopīgotu to ar saviem sekotājiem.",
Expand Down Expand Up @@ -369,7 +369,7 @@
"lightbox.close": "Aizvērt",
"lightbox.compress": "Saspiest attēla skata lodziņu",
"lightbox.expand": "Izvērst attēla skata lodziņu",
"lightbox.next": "Nākamais",
"lightbox.next": "Tālāk",
"lightbox.previous": "Iepriekšējais",
"limited_account_hint.action": "Tik un tā rādīt profilu",
"limited_account_hint.title": "{domain} moderatori ir paslēpuši šo profilu.",
Expand Down Expand Up @@ -422,8 +422,8 @@
"navigation_bar.search": "Meklēt",
"navigation_bar.security": "Drošība",
"not_signed_in_indicator.not_signed_in": "Lai piekļūtu šim resursam, tev ir jāpierakstās.",
"notification.admin.report": "{name} sūdzējās par {target}",
"notification.admin.sign_up": "{name} pierakstījās",
"notification.admin.report": "{name} ziņoja par {target}",
"notification.admin.sign_up": "{name} ir pierakstījies",
"notification.favourite": "{name} pievienoja tavu ziņu izlasei",
"notification.follow": "{name} uzsāka tev sekot",
"notification.follow_request": "{name} nosūtīja tev sekošanas pieprasījumu",
Expand All @@ -435,7 +435,7 @@
"notification.update": "{name} rediģēja ierakstu",
"notifications.clear": "Notīrīt paziņojumus",
"notifications.clear_confirmation": "Vai tiešām vēlies neatgriezeniski notīrīt visus savus paziņojumus?",
"notifications.column_settings.admin.report": "Jaunas sūdzības:",
"notifications.column_settings.admin.report": "Jauni ziņojumi:",
"notifications.column_settings.admin.sign_up": "Jaunas pierakstīšanās:",
"notifications.column_settings.alert": "Darbvirsmas paziņojumi",
"notifications.column_settings.favourite": "Izlase:",
Expand All @@ -445,7 +445,7 @@
"notifications.column_settings.follow": "Jauni sekotāji:",
"notifications.column_settings.follow_request": "Jauni sekošanas pieprasījumi:",
"notifications.column_settings.mention": "Pieminējumi:",
"notifications.column_settings.poll": "Aptauju rezultāti:",
"notifications.column_settings.poll": "Aptaujas rezultāti:",
"notifications.column_settings.push": "Uznirstošie paziņojumi",
"notifications.column_settings.reblog": "Pastiprinātie ieraksti:",
"notifications.column_settings.show": "Rādīt kolonnā",
Expand All @@ -457,13 +457,13 @@
"notifications.filter.all": "Visi",
"notifications.filter.boosts": "Pastiprinātie ieraksti",
"notifications.filter.favourites": "Izlases",
"notifications.filter.follows": "Sekošana",
"notifications.filter.follows": "Seko",
"notifications.filter.mentions": "Pieminējumi",
"notifications.filter.polls": "Aptauju rezultāti",
"notifications.filter.polls": "Aptaujas rezultāti",
"notifications.filter.statuses": "Jaunumi no cilvēkiem, kuriem tu seko",
"notifications.grant_permission": "Piešķirt atļauju.",
"notifications.group": "{count} paziņojumi",
"notifications.mark_as_read": "Atzīmēt visus paziņojumusizlasītus",
"notifications.mark_as_read": "Atzīmēt katru paziņojumuizlasītu",
"notifications.permission_denied": "Darbvirsmas paziņojumi nav pieejami, jo iepriekš tika noraidīts pārlūka atļauju pieprasījums",
"notifications.permission_denied_alert": "Darbvirsmas paziņojumus nevar iespējot, jo pārlūkprogrammai atļauja tika iepriekš atteikta",
"notifications.permission_required": "Darbvirsmas paziņojumi nav pieejami, jo nav piešķirta nepieciešamā atļauja.",
Expand Down Expand Up @@ -563,25 +563,25 @@
"report.reasons.spam": "Tas ir spams",
"report.reasons.spam_description": "Ļaunprātīgas saites, viltus iesaistīšana vai atkārtotas atbildes",
"report.reasons.violation": "Tas pārkāpj servera noteikumus",
"report.reasons.violation_description": "Tu zini, ka tas pārkāpj konkrētus noteikumus",
"report.reasons.violation_description": "Tu zini, ka tas pārkāpj īpašus noteikumus",
"report.rules.subtitle": "Atlasi visus atbilstošos",
"report.rules.title": "Kuri noteikumi tiek pārkāpti?",
"report.statuses.subtitle": "Atlasi visus atbilstošos",
"report.statuses.title": "Vai ir kādi ieraksti, kas atbalsta šo sūdzību?",
"report.submit": "Iesniegt",
"report.target": "Sūdzība par {target}",
"report.thanks.take_action": "Vari veikt šīs darbības, lai kontrolētu Mastodon redzamo saturu:",
"report.target": "Ziņošana par: {target}",
"report.thanks.take_action": "Tālāk ir norādītas iespējas, kā kontrolēt Mastodon redzamo saturu:",
"report.thanks.take_action_actionable": "Kamēr mēs to izskatām, tu vari veikt darbības pret @{name}:",
"report.thanks.title": "Vai nevēlies to redzēt?",
"report.thanks.title_actionable": "Paldies, ka ziņoji, mēs to izskatīsim.",
"report.unfollow": "Pārtraukt sekot @{name}",
"report.unfollow_explanation": "Tu seko šim kontam. Lai vairs neredzētu viņu ziņas savā mājas plūsmā, pārtrauc viņiem sekot.",
"report_notification.attached_statuses": "{count, plural, one {Pievienots {count} ieraksts} other {Pievienoti {count} ieraksti}}",
"report_notification.attached_statuses": "Pievienoti {count, plural,one {{count} sūtījums} other {{count} sūtījumi}}",
"report_notification.categories.legal": "Tiesisks",
"report_notification.categories.other": "Cita",
"report_notification.categories.spam": "Spams",
"report_notification.categories.violation": "Noteikumu pārkāpums",
"report_notification.open": "Atvērt sūdzību",
"report_notification.open": "Atvērt ziņojumu",
"search.no_recent_searches": "Nav nesen veiktu meklējumu",
"search.placeholder": "Meklēšana",
"search.quick_action.account_search": "Profili atbilst {x}",
Expand Down Expand Up @@ -628,7 +628,7 @@
"status.direct_indicator": "Pieminēts privāti",
"status.edit": "Rediģēt",
"status.edited": "Rediģēts {date}",
"status.edited_x_times": "Rediģēts {count, plural, one {{count} reizi} other {{count} reizes}}",
"status.edited_x_times": "Rediģēts {count, plural, one {{count} reize} other {{count} reizes}}",
"status.embed": "Iestrādāt",
"status.favourite": "Iecienīts",
"status.filter": "Filtrē šo ziņu",
Expand Down Expand Up @@ -656,8 +656,8 @@
"status.remove_bookmark": "Noņemt grāmatzīmi",
"status.replied_to": "Atbildēja {name}",
"status.reply": "Atbildēt",
"status.replyAll": "Atbildēt uz pavedienu",
"status.report": "Sūdzēties par @{name}",
"status.replyAll": "Atbildēt uz tematu",
"status.report": "Ziņot par @{name}",
"status.sensitive_warning": "Sensitīvs saturs",
"status.share": "Kopīgot",
"status.show_filter_reason": "Tomēr rādīt",
Expand All @@ -668,7 +668,7 @@
"status.show_original": "Rādīt oriģinālu",
"status.title.with_attachments": "{user} publicējis {attachmentCount, plural, one {pielikumu} other {{attachmentCount} pielikumus}}",
"status.translate": "Tulkot",
"status.translated_from_with": "Tulkots no {lang}, izmantojot {provider}",
"status.translated_from_with": "Tulkots no {lang} izmantojot {provider}",
"status.uncached_media_warning": "Priekšskatījums nav pieejams",
"status.unmute_conversation": "Noņemt sarunas apklusinājumu",
"status.unpin": "Noņemt profila piespraudumu",
Expand All @@ -681,16 +681,16 @@
"time_remaining.hours": "{number, plural, one {Atlikusi # stunda} other {Atlikušas # stundas}}",
"time_remaining.minutes": "{number, plural, one {Atlikusi # minūte} other {Atlikušas # minūtes}}",
"time_remaining.moments": "Atlikuši daži mirkļi",
"time_remaining.seconds": "{number, plural, one {Atlikusi # sekunde} other {Atlikušas # sekundes}}",
"time_remaining.seconds": "Atlikušas {number, plural, one {# sekunde} other {# sekundes}}",
"timeline_hint.remote_resource_not_displayed": "{resource} no citiem serveriem nav parādīti.",
"timeline_hint.resources.followers": "Sekotāji",
"timeline_hint.resources.follows": "Sekojošie",
"timeline_hint.resources.follows": "Seko",
"timeline_hint.resources.statuses": "Vecāki ieraksti",
"trends.counter_by_accounts": "{count, plural, one {{counter} persona} other {{counter} cilvēki}} par {days, plural, one {# dienu} other {{days} dienām}}",
"trends.trending_now": "Aktuālās tendences",
"ui.beforeunload": "Ja pametīsiet Mastodon, jūsu melnraksts tiks zaudēts.",
"ui.beforeunload": "Ja pametīsit Mastodonu, jūsu melnraksts tiks zaudēts.",
"units.short.billion": "{count}Mjd",
"units.short.million": "{count}Mjn",
"units.short.million": "{count}M",
"units.short.thousand": "{count}Tk",
"upload_area.title": "Velc un nomet, lai augšupielādētu",
"upload_button.label": "Pievienot bildi, video vai audio datni",
Expand All @@ -707,7 +707,7 @@
"upload_modal.apply": "Pielietot",
"upload_modal.applying": "Pielieto…",
"upload_modal.choose_image": "Izvēlēties attēlu",
"upload_modal.description_placeholder": "Raibais runcis Rīgā ratu rumbā rūc",
"upload_modal.description_placeholder": "Raibais runcis rīgā ratu rumbā rūc",
"upload_modal.detect_text": "Noteikt tekstu no attēla",
"upload_modal.edit_media": "Rediģēt multividi",
"upload_modal.hint": "Noklikšķini vai velc apli priekšskatījumā, lai izvēlētos fokusa punktu, kas vienmēr būs redzams visos sīktēlos.",
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/locales/ms.json
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@
"search_results.all": "Semua",
"search_results.hashtags": "Tanda pagar",
"search_results.nothing_found": "Tidak dapat menemui apa-apa untuk istilah carian tersebut",
"search_results.see_all": "Lihat semua",
"search_results.statuses": "Hantaran",
"search_results.title": "Mencari {q}",
"server_banner.about_active_users": "Pengguna pelayan ini sepanjang 30 hari yang lalu (Pengguna Aktif Bulanan)",
Expand Down
2 changes: 1 addition & 1 deletion app/javascript/mastodon/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@
"relative_time.today": "сегодня",
"reply_indicator.cancel": "Отмена",
"report.block": "Заблокировать",
"report.block_explanation": "В перестаните видеть посты этого пользователя, а он(а) больше не сможет подписаться на вас и читать ваши посты. Он(а) сможет понять что вы заблокировали его/её.",
"report.block_explanation": "Вы перестанете видеть посты этого пользователя, и он(а) больше не сможет подписаться на вас и читать ваши посты. Он(а) сможет понять, что вы заблокировали его/её.",
"report.categories.legal": "Правовая информация",
"report.categories.other": "Другое",
"report.categories.spam": "Спам",
Expand Down
Loading

0 comments on commit c14420e

Please sign in to comment.