From f8337b04fe9bccb1ad021a8579d85d366605e1b2 Mon Sep 17 00:00:00 2001 From: David Roetzel Date: Mon, 27 Jul 2026 16:53:20 +0200 Subject: [PATCH 01/20] Improve enforcement of collection item limit (#39969) --- app/models/collection.rb | 2 +- .../process_featured_item_service.rb | 7 +++-- spec/models/collection_spec.rb | 28 ++++++++++++------- .../process_featured_item_service_spec.rb | 11 ++++++++ 4 files changed, 35 insertions(+), 13 deletions(-) diff --git a/app/models/collection.rb b/app/models/collection.rb index 329460b574..0c1535ab39 100644 --- a/app/models/collection.rb +++ b/app/models/collection.rb @@ -54,7 +54,7 @@ class Collection < ApplicationRecord if: :remote? validates :language, language: { if: :local?, allow_nil: true } validate :tag_is_usable - validate :items_do_not_exceed_limit + validate :items_do_not_exceed_limit, if: :local? validate :user_does_not_exceed_limit, on: :create scope :with_items, -> { includes(:collection_items).merge(CollectionItem.with_accounts) } diff --git a/app/services/activitypub/process_featured_item_service.rb b/app/services/activitypub/process_featured_item_service.rb index fea25ca332..c89937eec1 100644 --- a/app/services/activitypub/process_featured_item_service.rb +++ b/app/services/activitypub/process_featured_item_service.rb @@ -17,9 +17,10 @@ class ActivityPub::ProcessFeaturedItemService return if non_matching_actor_and_approval_uris? return if non_supported_object_type? - with_redis_lock("collection_item:#{@item_json['id']}") do - @collection_item = existing_item || pre_approved_item || new_item + @collection_item = existing_item || pre_approved_item || new_item + return if @collection_item.nil? + with_redis_lock("collection_item:#{@item_json['id']}") do @collection_item.position = position unless position.nil? @collection_item.update!( uri: @item_json['id'], @@ -45,6 +46,8 @@ class ActivityPub::ProcessFeaturedItemService end def new_item + return if @collection.collection_items.count >= ActivityPub::ProcessFeaturedCollectionService::ITEMS_LIMIT + @collection.collection_items.new( created_at: @item_json['published'] ) diff --git a/spec/models/collection_spec.rb b/spec/models/collection_spec.rb index 921a30ea7c..3512bf48a3 100644 --- a/spec/models/collection_spec.rb +++ b/spec/models/collection_spec.rb @@ -51,20 +51,28 @@ RSpec.describe Collection do end context 'when there are more items than allowed' do - subject { Fabricate.build(:collection, collection_items:) } - let(:collection_items) { Fabricate.build_times(described_class::MAX_ITEMS + 1, :collection_item, collection: nil) } - it { is_expected.to_not be_valid } + context 'when collection is local' do + subject { Fabricate.build(:collection, collection_items:) } - context 'when the limit is only exceeded due to `rejected` and `revoked` items' do - let(:collection_items) do - items = Fabricate.build_times(described_class::MAX_ITEMS - 2, :collection_item, collection: nil, state: :accepted) - items << Fabricate.build(:collection_item, collection: nil, state: :pending) - items << Fabricate.build(:collection_item, collection: nil, state: :rejected) - items << Fabricate.build(:collection_item, collection: nil, state: :revoked) - items + it { is_expected.to_not be_valid } + + context 'when the limit is only exceeded due to `rejected` and `revoked` items' do + let(:collection_items) do + items = Fabricate.build_times(described_class::MAX_ITEMS - 2, :collection_item, collection: nil, state: :accepted) + items << Fabricate.build(:collection_item, collection: nil, state: :pending) + items << Fabricate.build(:collection_item, collection: nil, state: :rejected) + items << Fabricate.build(:collection_item, collection: nil, state: :revoked) + items + end + + it { is_expected.to be_valid } end + end + + context 'when collection is remote' do + subject { Fabricate.build(:remote_collection, collection_items:) } it { is_expected.to be_valid } end diff --git a/spec/services/activitypub/process_featured_item_service_spec.rb b/spec/services/activitypub/process_featured_item_service_spec.rb index 3b0f633fe0..706d5c9907 100644 --- a/spec/services/activitypub/process_featured_item_service_spec.rb +++ b/spec/services/activitypub/process_featured_item_service_spec.rb @@ -81,6 +81,17 @@ RSpec.describe ActivityPub::ProcessFeaturedItemService do expect(new_item.position).to eq 1 end end + + context "when the collection's item count is already at the limit" do + before do + stub_const('ActivityPub::ProcessFeaturedCollectionService::ITEMS_LIMIT', 3) + Fabricate.times(3, :collection_item, collection:) + end + + it 'does not create an item' do + expect { subject.call(collection, object) }.to_not change(collection.collection_items, :count) + end + end end context 'when item exists' do From 20c105c194edc1aa09d1c28b8008ca1f69e4bd13 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 28 Jul 2026 09:14:47 +0200 Subject: [PATCH 02/20] Remove support for `Reject` and `Accept` of `QuoteRequest` that cannot be found by `id` (#39833) --- app/lib/activitypub/activity.rb | 14 -------------- app/lib/activitypub/activity/accept.rb | 12 ------------ app/lib/activitypub/activity/reject.rb | 9 --------- 3 files changed, 35 deletions(-) diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb index 60f723eeab..60aef4d13d 100644 --- a/app/lib/activitypub/activity.rb +++ b/app/lib/activitypub/activity.rb @@ -122,20 +122,6 @@ class ActivityPub::Activity fetch_remote_original_status end - def quote_from_request_json(json) - quoted_status_uri = value_or_id(json['object']) - quoting_status_uri = value_or_id(json['instrument']) - return if quoting_status_uri.nil? || quoted_status_uri.nil? - - quoting_status = status_from_uri(quoting_status_uri) - return unless quoting_status.present? && quoting_status.quote.present? - - quoted_status = status_from_uri(quoted_status_uri) - return unless quoted_status.present? && quoted_status.account == @account && quoting_status.quote.quoted_status == quoted_status - - quoting_status.quote - end - def dereference_object! return unless @object.is_a?(String) diff --git a/app/lib/activitypub/activity/accept.rb b/app/lib/activitypub/activity/accept.rb index 67f211f8a1..a8daf39fac 100644 --- a/app/lib/activitypub/activity/accept.rb +++ b/app/lib/activitypub/activity/accept.rb @@ -10,8 +10,6 @@ class ActivityPub::Activity::Accept < ActivityPub::Activity case @object['type'] when 'Follow' accept_embedded_follow - when 'QuoteRequest' - accept_embedded_quote_request end end @@ -35,16 +33,6 @@ class ActivityPub::Activity::Accept < ActivityPub::Activity RemoteAccountRefreshWorker.perform_async(request.target_account_id) if is_first_follow end - def accept_embedded_quote_request - approval_uri = value_or_id(first_of_value(@json['result'])) - return if approval_uri.nil? - - quote = quote_from_request_json(@object) - return unless quote.present? && quote.status.local? - - accept_quote!(quote) - end - def accept_feature_request! approval_uri = value_or_id(first_of_value(@json['result'])) return if approval_uri.nil? || unsupported_uri_scheme?(approval_uri) || non_matching_uri_hosts?(approval_uri, @account.uri) diff --git a/app/lib/activitypub/activity/reject.rb b/app/lib/activitypub/activity/reject.rb index d27b60a604..b0a4a72436 100644 --- a/app/lib/activitypub/activity/reject.rb +++ b/app/lib/activitypub/activity/reject.rb @@ -11,8 +11,6 @@ class ActivityPub::Activity::Reject < ActivityPub::Activity case @object['type'] when 'Follow' reject_embedded_follow - when 'QuoteRequest' - reject_embedded_quote_request end end @@ -33,13 +31,6 @@ class ActivityPub::Activity::Reject < ActivityPub::Activity relay.update!(state: :rejected) end - def reject_embedded_quote_request - quote = quote_from_request_json(@object) - return unless quote.present? && quote.status.local? - - reject_quote!(quote) - end - def reject_quote!(quote) return unless quote.quoted_account == @account && quote.status.local? From e0efc9683fa2228a4b019dbc8dda687663329aa5 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 28 Jul 2026 10:09:21 +0200 Subject: [PATCH 03/20] Add uniqueness constraint on Account `uri` (#39882) --- app/models/account.rb | 6 +- ...60720090737_change_account_uri_nullable.rb | 19 +++ ...260720092724_change_account_uri_default.rb | 7 ++ .../20260720100326_fix_blank_account_uri.rb | 14 +++ ...819_rename_index_accounts_on_uri_to_old.rb | 7 ++ ...104058_add_unique_index_on_accounts_uri.rb | 115 ++++++++++++++++++ ...113713_remove_old_index_on_accounts_uri.rb | 9 ++ ...0260720124731_clean_up_invalid_accounts.rb | 15 +++ db/schema.rb | 6 +- lib/mastodon/cli/accounts.rb | 15 +-- lib/tasks/tests.rake | 44 +++++-- spec/fabricators/account_fabricator.rb | 2 +- spec/lib/mastodon/cli/accounts_spec.rb | 19 --- spec/lib/mastodon/cli/maintenance_spec.rb | 5 + 14 files changed, 236 insertions(+), 47 deletions(-) create mode 100644 db/migrate/20260720090737_change_account_uri_nullable.rb create mode 100644 db/migrate/20260720092724_change_account_uri_default.rb create mode 100644 db/post_migrate/20260720100326_fix_blank_account_uri.rb create mode 100644 db/post_migrate/20260720103819_rename_index_accounts_on_uri_to_old.rb create mode 100644 db/post_migrate/20260720104058_add_unique_index_on_accounts_uri.rb create mode 100644 db/post_migrate/20260720113713_remove_old_index_on_accounts_uri.rb create mode 100644 db/post_migrate/20260720124731_clean_up_invalid_accounts.rb diff --git a/app/models/account.rb b/app/models/account.rb index 9d5c4a78e0..2203c96ca6 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -54,7 +54,7 @@ # suspended_at :datetime # suspension_origin :integer # trendable :boolean -# uri :string default(""), not null +# uri :string # url :string # username :string default(""), not null # created_at :datetime not null @@ -122,7 +122,7 @@ class Account < ApplicationRecord validates :username, format: { with: USERNAME_ONLY_RE }, length: { maximum: USERNAME_LENGTH_HARD_LIMIT }, if: -> { (remote? || actor_type_application?) && will_save_change_to_username? } # Remote user validations - validates :uri, presence: true, unless: :local?, on: :create + validates :uri, presence: true, exclusion: { in: [''] }, uniqueness: true, unless: :local?, on: :create # Local user validations validates :username, format: { with: /\A[a-z0-9_]+\z/i }, length: { maximum: USERNAME_LENGTH_LIMIT }, if: -> { local? && will_save_change_to_username? && !actor_type_application? } @@ -136,7 +136,7 @@ class Account < ApplicationRecord validates :following_url, absence: true validates :inbox_url, absence: true validates :shared_inbox_url, absence: true - validates :uri, absence: true + validates :uri, absence: true, exclusion: { in: [''] } end validates :domain, exclusion: { in: [''] } diff --git a/db/migrate/20260720090737_change_account_uri_nullable.rb b/db/migrate/20260720090737_change_account_uri_nullable.rb new file mode 100644 index 0000000000..90fd898927 --- /dev/null +++ b/db/migrate/20260720090737_change_account_uri_nullable.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class ChangeAccountUriNullable < ActiveRecord::Migration[8.1] + disable_ddl_transaction! + + class Account < ApplicationRecord; end + + def up + change_column_null :accounts, :uri, true + end + + def down + change_column_null :accounts, :uri, false + rescue ActiveRecord::NotNullViolation + Account.where(uri: nil).update_all(uri: '') + + retry + end +end diff --git a/db/migrate/20260720092724_change_account_uri_default.rb b/db/migrate/20260720092724_change_account_uri_default.rb new file mode 100644 index 0000000000..576a19478e --- /dev/null +++ b/db/migrate/20260720092724_change_account_uri_default.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class ChangeAccountUriDefault < ActiveRecord::Migration[8.1] + def change + change_column_default :accounts, :uri, from: '', to: nil + end +end diff --git a/db/post_migrate/20260720100326_fix_blank_account_uri.rb b/db/post_migrate/20260720100326_fix_blank_account_uri.rb new file mode 100644 index 0000000000..451eede15a --- /dev/null +++ b/db/post_migrate/20260720100326_fix_blank_account_uri.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class FixBlankAccountUri < ActiveRecord::Migration[8.1] + # Dummy classes to make migration possible across version changes + class Account < ApplicationRecord; end + + def up + Account.where(uri: '').in_batches.update_all(uri: nil) + end + + def down + Account.where(uri: nil).in_batches.update_all(uri: '') + end +end diff --git a/db/post_migrate/20260720103819_rename_index_accounts_on_uri_to_old.rb b/db/post_migrate/20260720103819_rename_index_accounts_on_uri_to_old.rb new file mode 100644 index 0000000000..2c34a7058f --- /dev/null +++ b/db/post_migrate/20260720103819_rename_index_accounts_on_uri_to_old.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class RenameIndexAccountsOnUriToOld < ActiveRecord::Migration[8.1] + def change + rename_index :accounts, :index_accounts_on_uri, :old_index_accounts_on_uri + end +end diff --git a/db/post_migrate/20260720104058_add_unique_index_on_accounts_uri.rb b/db/post_migrate/20260720104058_add_unique_index_on_accounts_uri.rb new file mode 100644 index 0000000000..155b7bc470 --- /dev/null +++ b/db/post_migrate/20260720104058_add_unique_index_on_accounts_uri.rb @@ -0,0 +1,115 @@ +# frozen_string_literal: true + +class AddUniqueIndexOnAccountsUri < ActiveRecord::Migration[8.1] + disable_ddl_transaction! + + # Dummy classes to make migration possible across version changes + class Account < ApplicationRecord; end + class AccountDeletionRequest < ApplicationRecord; end + class AccountModerationNote < ApplicationRecord; end + class AccountNote < ApplicationRecord; end + class AccountPin < ApplicationRecord; end + class AccountStat < ApplicationRecord; end + class Appeal < ApplicationRecord; end + class Block < ApplicationRecord; end + class CanonicalEmailBlock < ApplicationRecord; end + class Collection < ApplicationRecord; end + class CollectionItem < ApplicationRecord; end + class Favourite < ApplicationRecord; end + class Follow < ApplicationRecord; end + class FollowRecommendationSuppression < ApplicationRecord; end + class FollowRequest < ApplicationRecord; end + class ListAccount < ApplicationRecord; end + + class MediaAttachment < ApplicationRecord + self.inheritance_column = nil + end + + class Mention < ApplicationRecord; end + class Mute < ApplicationRecord; end + + class Notification < ApplicationRecord + self.inheritance_column = nil + end + + class NotificationPermission < ApplicationRecord; end + class NotificationRequest < ApplicationRecord; end + class Poll < ApplicationRecord; end + class PollVote < ApplicationRecord; end + class Quote < ApplicationRecord; end + class Report < ApplicationRecord; end + class SeveredRelationship < ApplicationRecord; end + class Status < ApplicationRecord; end + class StatusPin < ApplicationRecord; end + class TagFollow < ApplicationRecord; end + class Tombstone < ApplicationRecord; end + + def up + add_index :accounts, :uri, algorithm: :concurrently, unique: true + rescue ActiveRecord::RecordNotUnique + deduplicate_and_reindex! + rescue + remove_index :accounts, name: :index_accounts_on_uri + raise + end + + def down + remove_index :accounts, name: :index_accounts_on_uri + end + + private + + def deduplicate_and_reindex! + deduplicate_accounts! + + safety_assured { execute 'REINDEX INDEX CONCURRENTLY index_accounts_on_uri' } + rescue ActiveRecord::RecordNotUnique + retry + end + + def deduplicate_accounts! + duplicate_uris = select_all('SELECT uri FROM accounts WHERE uri IS NOT NULL GROUP BY uri HAVING count(*) > 1').rows + + duplicate_uris.each do |uri| + # Fetch the conflicting accounts and keep the most recently-discovered one as reference + duplicate_records = Account.where(uri: uri).reorder(Arel.sql("COALESCE(last_webfingered_at, 'epoch'::date)"), :created_at, :id).to_a + reference_account = duplicate_records.pop + + duplicate_records.each do |other_account| + merge_accounts!(reference_account, other_account) + other_account.destroy + end + end + end + + def merge_accounts!(account, other_account) + { + account_id: [ + Status, StatusPin, MediaAttachment, Poll, Report, Tombstone, Favourite, + Follow, FollowRequest, Block, Mute, + AccountModerationNote, AccountPin, AccountStat, ListAccount, + PollVote, Mention, AccountDeletionRequest, AccountNote, FollowRecommendationSuppression, + Appeal, TagFollow, Quote, Collection, CollectionItem + ], + from_account_id: [ + Notification, NotificationPermission, NotificationRequest + ], + target_account_id: [ + Follow, FollowRequest, Block, Mute, AccountModerationNote, AccountPin, AccountNote + ], + reference_account_id: [CanonicalEmailBlock], + account_warning_id: [Appeal], + local_account_id: [SeveredRelationship], + remote_account_id: [SeveredRelationship], + quoted_account_id: [Quote], + }.each do |attribute, classes| + classes.each do |klass| + klass.where({ attribute => other_account.id }).reorder(nil).find_each do |record| + record.update_attribute(attribute, account.id) + rescue ActiveRecord::RecordNotUnique + next + end + end + end + end +end diff --git a/db/post_migrate/20260720113713_remove_old_index_on_accounts_uri.rb b/db/post_migrate/20260720113713_remove_old_index_on_accounts_uri.rb new file mode 100644 index 0000000000..e91b9c067d --- /dev/null +++ b/db/post_migrate/20260720113713_remove_old_index_on_accounts_uri.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class RemoveOldIndexOnAccountsUri < ActiveRecord::Migration[8.1] + disable_ddl_transaction! + + def change + remove_index :accounts, :uri, name: :old_index_accounts_on_uri, algorithm: :concurrently + end +end diff --git a/db/post_migrate/20260720124731_clean_up_invalid_accounts.rb b/db/post_migrate/20260720124731_clean_up_invalid_accounts.rb new file mode 100644 index 0000000000..14af030d73 --- /dev/null +++ b/db/post_migrate/20260720124731_clean_up_invalid_accounts.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CleanUpInvalidAccounts < ActiveRecord::Migration[8.1] + # Dummy classes to make migration possible across version changes + class Account < ApplicationRecord; end + + def up + # A very old bug could cause incompletely-processed remote accounts to be added + # to the database; those would not have a URI, which could be an issue in the + # future. Delete them. + Account.where.not(domain: nil).where(uri: nil).in_batches.delete_all + end + + def down; end +end diff --git a/db/schema.rb b/db/schema.rb index ecf113318d..4062dba353 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.1].define(version: 2026_07_06_143100) do +ActiveRecord::Schema[8.1].define(version: 2026_07_20_124731) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" @@ -204,14 +204,14 @@ ActiveRecord::Schema[8.1].define(version: 2026_07_06_143100) do t.integer "suspension_origin" t.boolean "trendable" t.datetime "updated_at", precision: nil, null: false - t.string "uri", default: "", null: false + t.string "uri" t.string "url" t.string "username", default: "", null: false t.index "(((setweight(to_tsvector('simple'::regconfig, (display_name)::text), 'A'::\"char\") || setweight(to_tsvector('simple'::regconfig, (username)::text), 'B'::\"char\")) || setweight(to_tsvector('simple'::regconfig, (COALESCE(domain, ''::character varying))::text), 'C'::\"char\")))", name: "search_index", using: :gin t.index "lower((username)::text), COALESCE(lower((domain)::text), ''::text)", name: "index_accounts_on_username_and_domain_lower", unique: true t.index ["domain", "id"], name: "index_accounts_on_domain_and_id" t.index ["moved_to_account_id"], name: "index_accounts_on_moved_to_account_id", where: "(moved_to_account_id IS NOT NULL)" - t.index ["uri"], name: "index_accounts_on_uri" + t.index ["uri"], name: "index_accounts_on_uri", unique: true t.index ["url"], name: "index_accounts_on_url", opclass: :text_pattern_ops, where: "(url IS NOT NULL)" end diff --git a/lib/mastodon/cli/accounts.rb b/lib/mastodon/cli/accounts.rb index 9f3fda2706..7f15a3686e 100644 --- a/lib/mastodon/cli/accounts.rb +++ b/lib/mastodon/cli/accounts.rb @@ -253,20 +253,11 @@ module Mastodon::CLI desc 'fix-duplicates', 'Find duplicate remote accounts and merge them' option :dry_run, type: :boolean long_desc <<-LONG_DESC - Merge known remote accounts sharing an ActivityPub actor identifier. - - Such duplicates can occur when a remote server admin misconfigures their - domain configuration. + This command is deprecated as of Mastodon v4.7.0. LONG_DESC def fix_duplicates - Account.remote.duplicate_uris.pluck(:uri).each do |uri| - say("Duplicates found for #{uri}") - begin - ActivityPub::FetchRemoteAccountService.new.call(uri) unless dry_run? - rescue => e - say("Error processing #{uri}: #{e}", :red) - end - end + # TODO: remove this after 4.7.0 + say('This command is deprecated as Mastodon v4.7.0 migrations enforce ActivityPub actor identifier uniqueness', :yellow) end desc 'backup USERNAME', 'Request a backup for a user' diff --git a/lib/tasks/tests.rake b/lib/tasks/tests.rake index 48d2233c93..73fa2dfd22 100644 --- a/lib/tasks/tests.rake +++ b/lib/tasks/tests.rake @@ -164,11 +164,23 @@ namespace :tests do exit(1) end + unless Account.find_by(uri: 'https://social.example.com/alice').domain == 'example.com' + puts 'Duplicate accounts with same URI incorrectly deduplicated' + exit(1) + end + + if Account.exists?(domain: 'example.com', username: %w(bogus1 bogus2 bogus3)) + puts 'Bogus remote accounts not correctly purged' + exit(1) + end + puts 'No errors found. Database state is consistent with a successful migration process.' end desc 'Populate the database with test data for 3.3.0' task populate_v3_3_0: :environment do # rubocop:disable Naming/VariableNumber + user_public_key = ActiveRecord::Base.connection.quote(OpenSSL::PKey::RSA.new(2048).public_key.to_pem) + ActiveRecord::Base.connection.execute(<<~SQL.squish) INSERT INTO "webauthn_credentials" (user_id, nickname, external_id, public_key, created_at, updated_at) @@ -206,6 +218,19 @@ namespace :tests do (token, application_id, scopes, resource_owner_id, created_at) VALUES ('secret', 2, 'write:accounts read:me', 4, now()); + + /* Duplicate remote accounts + Before Mastodon v4.7.0, we had no uniqueness constraint on account `uri`, which lead to issues. + Furthermore, older tests caused remote accounts without protocol identifiers. + */ + INSERT INTO "accounts" + (id, username, domain, uri, private_key, public_key, created_at, updated_at, last_webfingered_at) + VALUES + (12, 'alice', 'social.example.com', 'https://social.example.com/alice', NULL, #{user_public_key}, '2021-01-01'::date, now(), '2021-01-09'::date), + (13, 'alice', 'example.com', 'https://social.example.com/alice', NULL, #{user_public_key}, '2021-01-10'::date, now(), '2021-01-11'::date), + (14, 'bogus1', 'example.com', '', NULL, '', now(), now(), now()), + (15, 'bogus2', 'example.com', '', NULL, '', now(), now(), now()), + (16, 'bogus3', 'example.com', '', NULL, '', now(), now(), now()); SQL end @@ -336,19 +361,19 @@ namespace :tests do (2, 'user', NULL, #{user_private_key}, #{user_public_key}, now(), now()); INSERT INTO "accounts" - (id, username, domain, private_key, public_key, created_at, updated_at, remote_url, salmon_url) + (id, username, domain, uri, private_key, public_key, created_at, updated_at, remote_url, salmon_url) VALUES - (3, 'remote', 'remote.com', NULL, #{remote_public_key}, now(), now(), + (3, 'remote', 'remote.com', 'https://remote.com/remote', NULL, #{remote_public_key}, now(), now(), 'https://remote.com/@remote', 'https://remote.com/salmon/1'), - (4, 'Remote', 'remote.com', NULL, #{remote_public_key}, now(), now(), + (4, 'Remote', 'remote.com', 'https://remote.com/Remote', NULL, #{remote_public_key}, now(), now(), 'https://remote.com/@Remote', 'https://remote.com/salmon/1'), - (5, 'REMOTE', 'Remote.com', NULL, #{remote_public_key2}, now() - interval '1 year', now() - interval '1 year', + (5, 'REMOTE', 'Remote.com', 'https://remote.com/stale/remote', NULL, #{remote_public_key2}, now() - interval '1 year', now() - interval '1 year', 'https://remote.com/stale/@REMOTE', 'https://remote.com/stale/salmon/1'); INSERT INTO "accounts" - (id, username, domain, private_key, public_key, created_at, updated_at, protocol, inbox_url, outbox_url, followers_url) + (id, username, domain, uri, private_key, public_key, created_at, updated_at, protocol, inbox_url, outbox_url, followers_url) VALUES - (6, 'bob', 'ActivityPub.com', NULL, #{remote_public_key_ap}, now(), now(), + (6, 'bob', 'ActivityPub.com', 'https://activitypub.com/users/bob', NULL, #{remote_public_key_ap}, now(), now(), 1, 'https://activitypub.com/users/bob/inbox', 'https://activitypub.com/users/bob/outbox', 'https://activitypub.com/users/bob/followers'); INSERT INTO "accounts" @@ -358,10 +383,11 @@ namespace :tests do (8, 'pt_user', NULL, #{user_private_key}, #{user_public_key}, now(), now()); INSERT INTO "accounts" - (id, username, domain, private_key, public_key, created_at, updated_at, protocol, inbox_url, outbox_url, followers_url, suspended) + (id, username, domain, uri, private_key, public_key, created_at, updated_at, protocol, inbox_url, outbox_url, followers_url, suspended) VALUES - (9, 'evil', 'activitypub.com', NULL, #{remote_public_key_ap}, now(), now(), - 1, 'https://activitypub.com/users/evil/inbox', 'https://activitypub.com/users/evil/outbox', + (9, 'evil', 'activitypub.com', 'https://activitypub.com/users/evil', NULL, + #{remote_public_key_ap}, now(), now(), 1, + 'https://activitypub.com/users/evil/inbox', 'https://activitypub.com/users/evil/outbox', 'https://activitypub.com/users/evil/followers', true); -- users diff --git a/spec/fabricators/account_fabricator.rb b/spec/fabricators/account_fabricator.rb index 9e10a0d64e..4280b7f7d6 100644 --- a/spec/fabricators/account_fabricator.rb +++ b/spec/fabricators/account_fabricator.rb @@ -11,7 +11,7 @@ Fabricator(:account) do suspended_at { |attrs| attrs[:suspended] ? Time.now.utc : nil } silenced_at { |attrs| attrs[:silenced] ? Time.now.utc : nil } user { |attrs| attrs[:domain].nil? ? Fabricate.build(:user, account: nil) : nil } - uri { |attrs| attrs[:domain].nil? ? '' : "https://#{attrs[:domain]}/users/#{attrs[:username]}" } + uri { |attrs| attrs[:domain].nil? ? nil : "https://#{attrs[:domain]}/users/#{attrs[:username]}" } discoverable true indexable true diff --git a/spec/lib/mastodon/cli/accounts_spec.rb b/spec/lib/mastodon/cli/accounts_spec.rb index 73f5b83744..33f5d802f4 100644 --- a/spec/lib/mastodon/cli/accounts_spec.rb +++ b/spec/lib/mastodon/cli/accounts_spec.rb @@ -648,25 +648,6 @@ RSpec.describe Mastodon::CLI::Accounts do end end - describe '#fix_duplicates' do - let(:action) { :fix_duplicates } - let(:service_double) { instance_double(ActivityPub::FetchRemoteAccountService, call: nil) } - let(:uri) { 'https://host.example/same/value' } - - context 'when there are duplicate URI accounts' do - before do - Fabricate.times(2, :account, domain: 'host.example', uri: uri, legacy_keypair: true) - allow(ActivityPub::FetchRemoteAccountService).to receive(:new).and_return(service_double) - end - - it 'finds the duplicates and calls fetch remote account service' do - expect { subject } - .to output_results('Duplicates found') - expect(service_double).to have_received(:call).with(uri) - end - end - end - describe '#backup' do let(:action) { :backup } diff --git a/spec/lib/mastodon/cli/maintenance_spec.rb b/spec/lib/mastodon/cli/maintenance_spec.rb index 6e1fb3cb6d..38e15c91e1 100644 --- a/spec/lib/mastodon/cli/maintenance_spec.rb +++ b/spec/lib/mastodon/cli/maintenance_spec.rb @@ -89,6 +89,11 @@ RSpec.describe Mastodon::CLI::Maintenance do def prepare_duplicate_data ActiveRecord::Base.connection.remove_index :accounts, name: :index_accounts_on_username_and_domain_lower + + # Re-create without uniqueness constraint for test purposes + ActiveRecord::Base.connection.remove_index :accounts, :uri + ActiveRecord::Base.connection.add_index :accounts, :uri + duplicate_record(:account, username: duplicate_account_username, domain: duplicate_account_domain, legacy_keypair: true) duplicate_record(:account, username: duplicate_account_username, domain: nil) end From 29ce292daeea638b99080fcf8791cc112a12e773 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:11:23 +0000 Subject: [PATCH 04/20] Update dependency sass to v1.102.0 (#39910) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index e72591893f..d17a27814e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12898,8 +12898,8 @@ __metadata: linkType: hard "sass@npm:^1.62.1, sass@npm:^1.70.0": - version: 1.101.0 - resolution: "sass@npm:1.101.0" + version: 1.101.7 + resolution: "sass@npm:1.101.7" dependencies: "@parcel/watcher": "npm:^2.4.1" chokidar: "npm:^5.0.0" @@ -12910,7 +12910,7 @@ __metadata: optional: true bin: sass: sass.js - checksum: 10c0/1fbbcef2f767dec4d97773a2a084f4e1ef2e4abecf574e08743e52237069f1129a6b43b07b5c23aa3bcbf395509e40db758d9748a07940da227aa1626329a74d + checksum: 10c0/26f251b5f6db131fe55abc603a5a9890bdac45bf78199ec9b070a876736862d5b1bad610fbc1b4798022f658da0ba610428f87031f6788773b851620d89e7e60 languageName: node linkType: hard From d4763b73af6c27d51d558e4e8da7aa765104ed28 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:15:45 +0000 Subject: [PATCH 05/20] Update react monorepo to v19.2.8 (#39950) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/yarn.lock b/yarn.lock index d17a27814e..6396f40f9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12157,13 +12157,13 @@ __metadata: linkType: hard "react-dom@npm:^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0, react-dom@npm:^19.2.0": - version: 19.2.7 - resolution: "react-dom@npm:19.2.7" + version: 19.2.8 + resolution: "react-dom@npm:19.2.8" dependencies: scheduler: "npm:^0.27.0" peerDependencies: - react: ^19.2.7 - checksum: 10c0/970ff600f6e80d47d39e2f226f12f226173b3cba3382efc97c5f0cd663de9af38c7a4c11c213fb936094faeac83060d660247accaa96b752180d5b951b9cfecb + react: ^19.2.8 + checksum: 10c0/41ba2247b76f687fcfe5bbc99f514d6b851d8c8041c2f5ded36ed05bd7fdc5208cacbac9de51e3e6633e77f96f44cec9f0d4a5a55184dba4e00738f224439134 languageName: node linkType: hard @@ -12367,9 +12367,9 @@ __metadata: linkType: hard "react@npm:^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0, react@npm:^19.2.0": - version: 19.2.7 - resolution: "react@npm:19.2.7" - checksum: 10c0/0bd0e2f1bbd4ba97561c6597bf8a5fec05e6476fe61e165c1065598d16668efc6715205599c94d3ddd49d36cb0f21cbf1b9bcc18ee840b805ce222c3e8d558ac + version: 19.2.8 + resolution: "react@npm:19.2.8" + checksum: 10c0/5f86bdb56426652fd6d989d30a6f2e603c057272c47c9ca3a3fbe190a3a39ee9ccce937d63cfc039717abed1b8891d6a499134bc35311acc07eafdacd86537cd languageName: node linkType: hard From a264ae39f1fd3b6e047070d1c8e2183795745ce6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:15:53 +0000 Subject: [PATCH 06/20] Update dependency react-easy-crop to v6.2.3 (#39955) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6396f40f9b..11823ccd55 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12168,14 +12168,14 @@ __metadata: linkType: hard "react-easy-crop@npm:^6.0.0": - version: 6.2.2 - resolution: "react-easy-crop@npm:6.2.2" + version: 6.2.3 + resolution: "react-easy-crop@npm:6.2.3" dependencies: normalize-wheel: "npm:^1.0.1" peerDependencies: react: ">=16.4.0" react-dom: ">=16.4.0" - checksum: 10c0/57b51dd9cfb9e4ec7502dd145e380f942b2168d37253158ed5359cc7a59460ae85c48fa4b9d32a28a0d31a7aaf5a9957fc1168b71e59be10136af837efd896ac + checksum: 10c0/ca55a03eb9396c9cf9354aceaa0da585171a94cd86eabdd1aec482c96128cffade1438cbc2d8e221dc50f50c70d84538441f928bf4c3d7bc951d4c2b60a0be7e languageName: node linkType: hard From 69ed2e978c401e8b5556c00fdc1f81f2db87aa62 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:16:01 +0000 Subject: [PATCH 07/20] Update dependency csv to v3.3.6 (#39961) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 2ba4a258d0..7646d9375d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -182,7 +182,7 @@ GEM css_parser (3.0.0) addressable ssrf_filter (~> 1.5) - csv (3.3.5) + csv (3.3.6) database_cleaner-active_record (2.2.2) activerecord (>= 5.a) database_cleaner-core (~> 2.0) From dfa77897ca4ed1d6055f9286537df7c9ae7328cf Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 08:16:06 +0000 Subject: [PATCH 08/20] Update dependency simplecov to v1.0.3 (#39962) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 7646d9375d..9b6b0880ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -840,7 +840,7 @@ GEM simple_form (5.4.1) actionpack (>= 7.0) activemodel (>= 7.0) - simplecov (1.0.2) + simplecov (1.0.3) simplecov-lcov (0.9.0) ssrf_filter (1.5.0) stackprof (0.2.28) From 8552bd79b0faafcb653d9d2f50bb2f06d76eb663 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 28 Jul 2026 10:30:21 +0200 Subject: [PATCH 09/20] Remove processing of collections of activities (#39932) --- ...service.rb => process_activity_service.rb} | 21 +++---------------- app/workers/activitypub/processing_worker.rb | 2 +- ...ec.rb => process_activity_service_spec.rb} | 2 +- .../activitypub/processing_worker_spec.rb | 8 +++---- 4 files changed, 9 insertions(+), 24 deletions(-) rename app/services/activitypub/{process_collection_service.rb => process_activity_service.rb} (89%) rename spec/services/activitypub/{process_collection_service_spec.rb => process_activity_service_spec.rb} (99%) diff --git a/app/services/activitypub/process_collection_service.rb b/app/services/activitypub/process_activity_service.rb similarity index 89% rename from app/services/activitypub/process_collection_service.rb rename to app/services/activitypub/process_activity_service.rb index 315e0c2635..2e66044ff2 100644 --- a/app/services/activitypub/process_collection_service.rb +++ b/app/services/activitypub/process_activity_service.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -class ActivityPub::ProcessCollectionService < BaseService +class ActivityPub::ProcessActivityService < BaseService include JsonLdHelper include DomainControlHelper @@ -64,14 +64,8 @@ class ActivityPub::ProcessCollectionService < BaseService @json.delete('signature') unless safe_for_forwarding?(original_json, @json) end - case @json['type'] - when 'Collection', 'CollectionPage' - process_items @json['items'] - when 'OrderedCollection', 'OrderedCollectionPage' - process_items @json['orderedItems'] - else - process_items [@json] - end + activity = ActivityPub::Activity.factory(@json, @account, **@options) + activity&.perform rescue JSON::ParserError nil end @@ -90,15 +84,6 @@ class ActivityPub::ProcessCollectionService < BaseService %w(Delete Reject Undo Update).include?(@json['type']) end - def process_items(items) - items.reverse_each.filter_map { |item| process_item(item) } - end - - def process_item(item) - activity = ActivityPub::Activity.factory(item, @account, **@options) - activity&.perform - end - def actor_from_verified_ld_signature return unless @json['signature'].is_a?(Hash) return if domain_not_allowed?(@json['signature']['creator']) diff --git a/app/workers/activitypub/processing_worker.rb b/app/workers/activitypub/processing_worker.rb index 1bb94b7f26..5ccbaff44c 100644 --- a/app/workers/activitypub/processing_worker.rb +++ b/app/workers/activitypub/processing_worker.rb @@ -13,7 +13,7 @@ class ActivityPub::ProcessingWorker return if actor.nil? - ActivityPub::ProcessCollectionService.new.call(body, actor, override_timestamps: true, delivered_to_account_id: delivered_to_account_id, delivery: true) + ActivityPub::ProcessActivityService.new.call(body, actor, override_timestamps: true, delivered_to_account_id: delivered_to_account_id, delivery: true) rescue ActiveRecord::RecordInvalid => e Rails.logger.debug { "Error processing incoming ActivityPub object: #{e}" } end diff --git a/spec/services/activitypub/process_collection_service_spec.rb b/spec/services/activitypub/process_activity_service_spec.rb similarity index 99% rename from spec/services/activitypub/process_collection_service_spec.rb rename to spec/services/activitypub/process_activity_service_spec.rb index 7e3e5a6695..8e547c4f47 100644 --- a/spec/services/activitypub/process_collection_service_spec.rb +++ b/spec/services/activitypub/process_activity_service_spec.rb @@ -2,7 +2,7 @@ require 'rails_helper' -RSpec.describe ActivityPub::ProcessCollectionService do +RSpec.describe ActivityPub::ProcessActivityService do subject { described_class.new } let(:actor) { Fabricate(:account, domain: 'example.com', uri: 'http://example.com/account') } diff --git a/spec/workers/activitypub/processing_worker_spec.rb b/spec/workers/activitypub/processing_worker_spec.rb index c06ba63d39..dd99a5d52d 100644 --- a/spec/workers/activitypub/processing_worker_spec.rb +++ b/spec/workers/activitypub/processing_worker_spec.rb @@ -8,11 +8,11 @@ RSpec.describe ActivityPub::ProcessingWorker do let(:account) { Fabricate(:account) } describe '#perform' do - it 'delegates to ActivityPub::ProcessCollectionService' do - allow(ActivityPub::ProcessCollectionService).to receive(:new) - .and_return(instance_double(ActivityPub::ProcessCollectionService, call: nil)) + it 'delegates to ActivityPub::ProcessActivityService' do + allow(ActivityPub::ProcessActivityService).to receive(:new) + .and_return(instance_double(ActivityPub::ProcessActivityService, call: nil)) subject.perform(account.id, '') - expect(ActivityPub::ProcessCollectionService).to have_received(:new) + expect(ActivityPub::ProcessActivityService).to have_received(:new) end end end From dca7bc42d25a55351c14861ea9c68229aaf54397 Mon Sep 17 00:00:00 2001 From: Echo Date: Tue, 28 Jul 2026 10:35:21 +0200 Subject: [PATCH 10/20] Cancel emoji search requests (#39947) --- app/javascript/mastodon/actions/compose.js | 32 ++++++--- .../mastodon/features/emoji/picker.ts | 68 ++++++++++++------- .../mastodon/features/emoji/search.ts | 15 ++++ .../styles/mastodon/components.scss | 2 +- 4 files changed, 81 insertions(+), 36 deletions(-) diff --git a/app/javascript/mastodon/actions/compose.js b/app/javascript/mastodon/actions/compose.js index ea446e2c5a..d6d2fa0ac3 100644 --- a/app/javascript/mastodon/actions/compose.js +++ b/app/javascript/mastodon/actions/compose.js @@ -20,6 +20,8 @@ import { insertStatusIntoAccountTimelines } from './timelines_typed'; let fetchComposeSuggestionsAccountsController; /** @type {AbortController | undefined} */ let fetchComposeSuggestionsTagsController; +/** @type {AbortController | undefined} */ +let searchComposeSuggestionsEmojiController; export const COMPOSE_CHANGE = 'COMPOSE_CHANGE'; export const COMPOSE_SUBMIT_REQUEST = 'COMPOSE_SUBMIT_REQUEST'; @@ -500,9 +502,8 @@ export function undoUploadCompose(media_id) { } export function clearComposeSuggestions() { - if (fetchComposeSuggestionsAccountsController) { - fetchComposeSuggestionsAccountsController.abort(); - } + fetchComposeSuggestionsAccountsController?.abort(); + searchComposeSuggestionsEmojiController?.abort(); return { type: COMPOSE_SUGGESTIONS_CLEAR, }; @@ -535,12 +536,25 @@ const fetchComposeSuggestionsAccounts = throttle((dispatch, token) => { }); }, 200, { leading: true, trailing: true }); -const fetchComposeSuggestionsEmojis = async (dispatch, token) => { - // Right now we are hard-coding the locale to English since the picker search only supports English. - // Once we replace the legacy picker we can remove this and use the actual locale of the user. - const results = await emojiMartSearch(token, 'en', 5); - dispatch(readyComposeSuggestionsEmojis(token, results)); -}; +const fetchComposeSuggestionsEmojis = (dispatch, token) => { + dispatch(clearComposeSuggestions()); + searchComposeSuggestionsEmojiController = new AbortController(); + + void emojiMartSearch({ + token, + // Right now we are hard-coding the locale to English since the picker search only supports English. + // Once we replace the legacy picker we can remove this and use the actual locale of the user. + locale: 'en', + limit: 5, + signal: searchComposeSuggestionsEmojiController.signal, + }).then((results) => { + if (results) { + dispatch(readyComposeSuggestionsEmojis(token, results)); + } + }).finally(() => { + searchComposeSuggestionsEmojiController = undefined; + }); +} const fetchComposeSuggestionsTags = throttle((dispatch, token) => { if (fetchComposeSuggestionsTagsController) { diff --git a/app/javascript/mastodon/features/emoji/picker.ts b/app/javascript/mastodon/features/emoji/picker.ts index c83df7ba8c..f638c91907 100644 --- a/app/javascript/mastodon/features/emoji/picker.ts +++ b/app/javascript/mastodon/features/emoji/picker.ts @@ -22,34 +22,50 @@ type LegacyEmoji = }; // Replicates the old legacy search function. -export async function emojiMartSearch( - token: string, - locale: string, +export async function emojiMartSearch({ + token, + locale, limit = 5, -): Promise { - const query = token.replace(':', '').trim(); - if (!query.length) { - return []; + signal, +}: { + token: string; + locale: string; + limit?: number; + signal?: AbortSignal; +}): Promise { + try { + const query = token.replace(':', '').trim(); + if (!query.length) { + return []; + } + + const cacheKey = `${query}|${locale}|${limit}`; + const cachedResult = searchCache.get(cacheKey); + if (cachedResult) { + return cachedResult; + } + + const results = await search({ + query, + locale, + limit, + signal, + }); + const legacyResults = results.map((emoji) => + 'shortcode' in emoji + ? ({ id: emoji.shortcode, custom: true } as const) + : { + id: emoji.label.replaceAll(' ', '_').toLowerCase(), + native: emoji.unicode, + }, + ); + searchCache.set(cacheKey, legacyResults); + + return legacyResults; + } catch { + log('aborted search for "%s"', token); + return null; } - - const cacheKey = `${query}|${locale}|${limit}`; - const cachedResult = searchCache.get(cacheKey); - if (cachedResult) { - return cachedResult; - } - - const results = await search({ query, locale, limit }); - const legacyResults = results.map((emoji) => - 'shortcode' in emoji - ? ({ id: emoji.shortcode, custom: true } as const) - : { - id: emoji.label.replaceAll(' ', '_').toLowerCase(), - native: emoji.unicode, - }, - ); - searchCache.set(cacheKey, legacyResults); - - return legacyResults; } const defaultCategories = [ diff --git a/app/javascript/mastodon/features/emoji/search.ts b/app/javascript/mastodon/features/emoji/search.ts index dcdd6be500..140cd4b205 100644 --- a/app/javascript/mastodon/features/emoji/search.ts +++ b/app/javascript/mastodon/features/emoji/search.ts @@ -56,13 +56,18 @@ export async function search({ query: rawQuery, locale: localeString, limit = 0, + signal, }: { query: string; locale: string; limit?: number; + signal?: AbortSignal; }) { + log('searching for "%s"', rawQuery); performance.mark('emoji-search-start'); + signal?.throwIfAborted(); + // Get the locale, and extract tokens from the query. const locale = toSupportedLocale(localeString); const segmenter = localeToSegmenter(locale); @@ -93,6 +98,7 @@ export async function search({ locale, i === queryTokens.length - 1, ); + signal?.throwIfAborted(); const resultMap: ScoreMap = new Map(); const checkedSet = new Set(); @@ -121,6 +127,7 @@ export async function search({ } // Score based on legacy shortcodes, using the higher score if there's a match. + signal?.throwIfAborted(); for (const shortcodeResult of shortcodeResults) { const emoji = resultMap.get(shortcodeResult.hexcode) ?? @@ -183,7 +190,9 @@ export async function search({ // If there are no results, try a cursor-based custom emoji search instead. if (mixedResults.length === 0 || mixedResults.length < limit) { + signal?.throwIfAborted(); const customEmojisFound = await fullCustomSearch(query, allEmojiIds); + signal?.throwIfAborted(); if (customEmojisFound.length > 0) { log( 'cursor search found %d results for "%s"', @@ -373,6 +382,8 @@ async function fullCustomSearch(query: string, existing = new Set()) { // First iterate over chunks of 1,000 custom emoji keys and find any matches. const chunkSize = 1_000; + const maxIterations = 10; + let index = 0; let lastKey: string | null = null; let keys: string[] = []; do { @@ -389,6 +400,10 @@ async function fullCustomSearch(query: string, existing = new Set()) { foundEmojis.add(key); } } + index++; + if (index >= maxIterations) { + break; + } } while (keys.length === chunkSize); // Next get the full emojis for all matches. diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 11f5d60702..a8624c7d11 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -518,7 +518,7 @@ body > [data-popover-placement] { } .autosuggest-account .account__avatar, -.autosuggest-emoji img { +.autosuggest-emoji .emojione { display: block; width: 24px; height: 24px; From 87562a0ca2ef52699a91202c4bc0316156c8578a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 11:00:17 +0200 Subject: [PATCH 11/20] New Crowdin Translations (automated) (#39971) Co-authored-by: GitHub Actions --- app/javascript/mastodon/locales/vi.json | 70 ++++++++++++------------- config/locales/ko.yml | 2 +- config/locales/simple_form.vi.yml | 1 + config/locales/vi.yml | 12 +++++ 4 files changed, 49 insertions(+), 36 deletions(-) diff --git a/app/javascript/mastodon/locales/vi.json b/app/javascript/mastodon/locales/vi.json index 043fbdc59c..5e8c6cd6da 100644 --- a/app/javascript/mastodon/locales/vi.json +++ b/app/javascript/mastodon/locales/vi.json @@ -807,21 +807,21 @@ "intervals.full.days": "{number, plural, other {# ngày}}", "intervals.full.hours": "{number, plural, other {# giờ}}", "intervals.full.minutes": "{number, plural, other {# phút}}", - "keyboard_shortcuts.back": "quay lại", - "keyboard_shortcuts.blocked": "mở danh sách tài khoản đã chặn", - "keyboard_shortcuts.boost": "đăng lại tút", - "keyboard_shortcuts.column": "mở các cột", - "keyboard_shortcuts.compose": "mở khung soạn tút", + "keyboard_shortcuts.back": "Quay lại", + "keyboard_shortcuts.blocked": "Mở danh sách tài khoản đã chặn", + "keyboard_shortcuts.boost": "Đăng lại tút", + "keyboard_shortcuts.column": "Mở các cột", + "keyboard_shortcuts.compose": "Mở khung soạn tút", "keyboard_shortcuts.description": "Mô tả", - "keyboard_shortcuts.direct": "mở nhắn riêng", - "keyboard_shortcuts.down": "di chuyển xuống dưới danh sách", - "keyboard_shortcuts.enter": "mở tút", - "keyboard_shortcuts.explore": "mở bảng tin xu hướng", - "keyboard_shortcuts.favourite": "thích tút", - "keyboard_shortcuts.favourites": "mở lượt thích", - "keyboard_shortcuts.federated": "mở mạng liên hợp", + "keyboard_shortcuts.direct": "Mở nhắn riêng", + "keyboard_shortcuts.down": "Chuyển xuống trong danh sách", + "keyboard_shortcuts.enter": "Mở tút", + "keyboard_shortcuts.explore": "Mở xu hướng", + "keyboard_shortcuts.favourite": "Thích tút", + "keyboard_shortcuts.favourites": "Mở lượt thích", + "keyboard_shortcuts.federated": "Mở bảng tin liên hợp", "keyboard_shortcuts.heading": "Danh sách phím tắt", - "keyboard_shortcuts.home": "mở trang chủ", + "keyboard_shortcuts.home": "Mở trang chủ", "keyboard_shortcuts.hotkey": "Phím tắt", "keyboard_shortcuts.keys.alt": "Alt", "keyboard_shortcuts.keys.backspace": "Backspace", @@ -829,29 +829,29 @@ "keyboard_shortcuts.keys.esc": "Esc", "keyboard_shortcuts.keys.page_down": "Page Down", "keyboard_shortcuts.keys.page_up": "Page Up", - "keyboard_shortcuts.legend": "hiện bảng hướng dẫn này", - "keyboard_shortcuts.load_more": "mở nút \"Tải thêm\"", - "keyboard_shortcuts.local": "mở máy chủ của bạn", - "keyboard_shortcuts.mention": "nhắc đến ai đó", - "keyboard_shortcuts.muted": "mở danh sách tài khoản đã phớt lờ", - "keyboard_shortcuts.my_profile": "mở hồ sơ của bạn", - "keyboard_shortcuts.notifications": "mở thông báo", - "keyboard_shortcuts.open_media": "mở ảnh hoặc video", - "keyboard_shortcuts.pinned": "mở những tút đã ghim", - "keyboard_shortcuts.profile": "mở trang của người đăng tút", - "keyboard_shortcuts.quote": "trích dẫn tút", - "keyboard_shortcuts.reply": "trả lời", - "keyboard_shortcuts.requests": "mở danh sách yêu cầu theo dõi", - "keyboard_shortcuts.search": "mở tìm kiếm", - "keyboard_shortcuts.spoilers": "ẩn/hiện nội dung nhạy cảm", - "keyboard_shortcuts.start": "mở \"Dành cho người mới\"", - "keyboard_shortcuts.toggle_hidden": "ẩn/hiện nội dung ẩn", - "keyboard_shortcuts.toggle_sensitivity": "ẩn/hiện ảnh hoặc video", - "keyboard_shortcuts.toot": "soạn tút mới", - "keyboard_shortcuts.top": "di chuyển đến đầu danh sách", + "keyboard_shortcuts.legend": "Hiện bảng hướng dẫn này", + "keyboard_shortcuts.load_more": "Mở nút \"Tải thêm\"", + "keyboard_shortcuts.local": "Mở bảng tin máy chủ", + "keyboard_shortcuts.mention": "Nhắc đến tác giả tút", + "keyboard_shortcuts.muted": "Mở danh sách tài khoản đã phớt lờ", + "keyboard_shortcuts.my_profile": "Mở hồ sơ của bạn", + "keyboard_shortcuts.notifications": "Mở cột thông báo", + "keyboard_shortcuts.open_media": "Mở phương tiện", + "keyboard_shortcuts.pinned": "Mở những tút đã ghim", + "keyboard_shortcuts.profile": "Mở trang của tác giả tút", + "keyboard_shortcuts.quote": "Trích dẫn tút", + "keyboard_shortcuts.reply": "Trả lời", + "keyboard_shortcuts.requests": "Mở danh sách yêu cầu theo dõi", + "keyboard_shortcuts.search": "Mở thanh tìm kiếm", + "keyboard_shortcuts.spoilers": "Ẩn/hiện trường nội dung nhạy cảm", + "keyboard_shortcuts.start": "Mở \"Dành cho người mới\"", + "keyboard_shortcuts.toggle_hidden": "Ẩn/hiện nội dung nhạy cảm", + "keyboard_shortcuts.toggle_sensitivity": "Ẩn/hiện phương tiện", + "keyboard_shortcuts.toot": "Soạn tút mới", + "keyboard_shortcuts.top": "Chuyển lên đầu danh sách", "keyboard_shortcuts.translate": "Dịch tút", - "keyboard_shortcuts.unfocus": "đưa con trỏ ra khỏi ô soạn thảo hoặc ô tìm kiếm", - "keyboard_shortcuts.up": "di chuyển lên trên danh sách", + "keyboard_shortcuts.unfocus": "Đưa con trỏ ra khỏi ô soạn thảo/tìm kiếm", + "keyboard_shortcuts.up": "Chuyển lên trong danh sách", "learn_more_link.got_it": "Đã hiểu", "learn_more_link.learn_more": "Tìm hiểu thêm", "lightbox.close": "Đóng", diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 1322ba0e2d..5bc3857305 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -355,7 +355,7 @@ ko: open: 열기 title: 계정 컬렉션 - @%{name} view_publicly: 공개시점으로 보기 - critical_update_pending: 긴급 업데이트 보류 중 + critical_update_pending: 긴급 업데이트 대기중 custom_emojis: assign_category: 분류 지정 by_domain: 도메인 diff --git a/config/locales/simple_form.vi.yml b/config/locales/simple_form.vi.yml index 548c9cbae6..869150f0a9 100644 --- a/config/locales/simple_form.vi.yml +++ b/config/locales/simple_form.vi.yml @@ -344,6 +344,7 @@ vi: notification_emails: appeal: Ai đó khiếu nại kiểm duyệt digest: Gửi email định kỳ + end_of_support: Phiên bản Mastodon hiện tại sắp kết thúc hỗ trợ favourite: Ai đó thích tút của bạn follow: Ai đó theo dõi bạn follow_request: Ai đó yêu cầu theo dõi bạn diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 542c478f33..1912b0e537 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -997,6 +997,7 @@ vi: critical_update: Quan trọng — vui lòng cập nhật sớm description: Bạn nên cập nhật Mastodon phiên bản mới nhất để được hưởng lợi từ các bản sửa lỗi và thêm tính năng mới. Nhất là để tránh các vấn đề bảo mật. Vì những lý do này, Mastodon sẽ kiểm tra các bản cập nhật 30 phút một lần và sẽ thông báo cho bạn theo tùy chọn thông báo qua email của bạn. documentation_link: Tìm hiểu thêm + nearing_eol: Việc hỗ trợ cho nhánh bạn đang sử dụng sẽ kết thúc vào ngày %{date}, vui lòng cân nhắc cập nhật. release_notes: Có gì mới? supported_until: Kết thúc hỗ trợ vào %{date} title: Bản cập nhật mới @@ -1005,6 +1006,7 @@ vi: major: Bản cập nhật lớn minor: Bản cập nhật nhỏ patch: Bản vá - sửa lỗi và dễ dàng áp dụng các thay đổi + unsupported_branch: Việc hỗ trợ cho nhánh bạn đang sử dụng đã kết thúc; vui lòng cân nhắc cập nhật. unsupported_since: Không còn được hỗ trợ vào %{date} version: Phiên bản statuses: @@ -1266,6 +1268,15 @@ vi: auto_close_registrations: body: Do gần đây thiếu kiểm duyệt viên nên việc đăng ký trên %{instance} sẽ tự động chuyển thành duyệt thủ công, để tránh %{instance} bị sử dụng làm nền tảng cho những kẻ xấu. Bạn có thể chuyển nó trở lại trạng thái đăng ký mở bất kỳ lúc nào. subject: Đăng ký mới %{instance} đã được tự động chuyển sang duyệt thủ công + end_of_support_out_of_support_warning: + body: Phiên bản Mastodon hiện đang được sử dụng trên máy chủ của bạn không còn được hỗ trợ nữa. Chúng tôi khuyên bạn nên cập nhật càng sớm càng tốt! + subject: Mastodon %{branch} đang được sử dụng trên %{instance} hiện không còn được hỗ trợ! + end_of_support_three_months_warning: + body: Phiên bản Mastodon hiện đang được sử dụng trên máy chủ của bạn sẽ ngừng được hỗ trợ trong vòng 3 tháng tới. Bạn nên cân nhắc cập nhật lên một nhánh mới hơn từ sớm. + subject: Hỗ trợ cho Mastodon %{branch} đang được sử dụng trên %{instance} sẽ kết thúc sau 3 tháng nữa. + end_of_support_two_weeks_warning: + body: Phiên bản Mastodon hiện đang được sử dụng trên máy chủ của bạn sẽ ngừng được hỗ trợ trong 2 tuần nữa. Chúng tôi khuyến nghị bạn nên cập nhật lên một nhánh mới hơn trước thời hạn đó. + subject: Hỗ trợ cho Mastodon %{branch} đang được sử dụng trên %{instance} sẽ kết thúc sau 2 tuần nữa. new_appeal: actions: delete_statuses: xóa tút của họ @@ -1877,6 +1888,7 @@ vi: administration_emails: Thông báo email admin email_events: Hoạt động thông báo email email_events_hint: 'Chọn những hoạt động sẽ gửi thông báo qua email:' + moderation_emails: Thông báo qua email về việc kiểm duyệt number: human: decimal_units: From 62d79cc7f0a1a9efd6f17cc513c77241875c9d1b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 11:00:26 +0200 Subject: [PATCH 12/20] Update dependency @vitejs/plugin-legacy to v8.2.2 (#39938) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 11823ccd55..4c7644aad0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5367,8 +5367,8 @@ __metadata: linkType: hard "@vitejs/plugin-legacy@npm:^8.0.0": - version: 8.2.1 - resolution: "@vitejs/plugin-legacy@npm:8.2.1" + version: 8.2.2 + resolution: "@vitejs/plugin-legacy@npm:8.2.2" dependencies: "@babel/core": "npm:^7.29.7" "@babel/plugin-transform-dynamic-import": "npm:^7.29.7" @@ -5379,13 +5379,13 @@ __metadata: browserslist: "npm:^4.28.6" browserslist-to-esbuild: "npm:^2.1.1" core-js: "npm:^3.49.0" - magic-string: "npm:^0.30.21" + magic-string: "npm:^1.0.0" regenerator-runtime: "npm:^0.14.1" systemjs: "npm:^6.15.1" peerDependencies: terser: ^5.16.0 vite: ^8.0.0 - checksum: 10c0/c9c65e1c89f93f22d34dccf27fbf2b7ed63be708819741eb4c8efe329911b8dd904d658e9ba7e287da6af7745bd87e870e4237e0b08a2a39c9628df0d3008e6c + checksum: 10c0/b317ba6edd105b117c0d6dd5a60a5f66dbf6dcbd08910c60e801c94525d281636529da3d402d5150e3ebdc6b688433bcbe28ee01d4218b4860fd90b98728d6a6 languageName: node linkType: hard @@ -10048,6 +10048,15 @@ __metadata: languageName: node linkType: hard +"magic-string@npm:^1.0.0": + version: 1.1.0 + resolution: "magic-string@npm:1.1.0" + dependencies: + "@jridgewell/sourcemap-codec": "npm:^1.5.5" + checksum: 10c0/f904dee2fd190ee5450c754234d8a831228677e9092ed2e545e42746beecf18d617156eb911af55a14496ebe1e60179678c4080c919f74eca7738eba3f38f13a + languageName: node + linkType: hard + "magicast@npm:^0.5.2": version: 0.5.2 resolution: "magicast@npm:0.5.2" From a9796c5d9b334bbe8e76f237aad096199f847b71 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 11:41:56 +0200 Subject: [PATCH 13/20] Update dependency @vitejs/plugin-react to v6.0.4 (#39925) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 4c7644aad0..d868051634 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5390,8 +5390,8 @@ __metadata: linkType: hard "@vitejs/plugin-react@npm:^6.0.0": - version: 6.0.3 - resolution: "@vitejs/plugin-react@npm:6.0.3" + version: 6.0.4 + resolution: "@vitejs/plugin-react@npm:6.0.4" dependencies: "@rolldown/pluginutils": "npm:^1.0.1" peerDependencies: @@ -5403,7 +5403,7 @@ __metadata: optional: true babel-plugin-react-compiler: optional: true - checksum: 10c0/592a93178c0eec420759d529a2c964a7103860808f549f72993b96a38c287c929a0d371cacbd932c37ee2118b830348db752cc01a31d688c71d19d74567251fa + checksum: 10c0/38446b54f51760b97d81abfa2fb9130bdc7a545183c97b26cfc7a5982fbcbeef431f482a3d44ef8225ca3e8c37e852a0843f8f84d0834391cab49b36a172dbf8 languageName: node linkType: hard From 6e368f649a941b10c4121a2f2628c3c7a4de5dff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Jul 2026 11:42:29 +0200 Subject: [PATCH 14/20] Update dependency @unhead/react to v3.2.3 (#39883) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- yarn.lock | 693 ++++++++++++++++++++++-------------------------------- 1 file changed, 287 insertions(+), 406 deletions(-) diff --git a/yarn.lock b/yarn.lock index d868051634..ce7b5bebfa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1904,18 +1904,37 @@ __metadata: languageName: node linkType: hard -"@devframes/hub@npm:^0.5.4": - version: 0.5.4 - resolution: "@devframes/hub@npm:0.5.4" +"@devframes/hub@npm:^0.7.11": + version: 0.7.11 + resolution: "@devframes/hub@npm:0.7.11" dependencies: birpc: "npm:^4.0.0" - nostics: "npm:^0.2.0" + destr: "npm:^2.0.5" + nostics: "npm:^1.2.0" pathe: "npm:^2.0.3" perfect-debounce: "npm:^2.1.0" - tinyexec: "npm:^1.2.2" + tinyexec: "npm:^1.2.4" + zigpty: "npm:^0.2.1" peerDependencies: - devframe: 0.5.4 - checksum: 10c0/335f3f8510e11b564cc6af3e0b7783c311ab3682fa4e1c0aea4fad4ca151de0c8cd7fe0d3e058aa4b3f235fa6630816d279669ad9ef7b139bbb866f8c70bfd7e + devframe: 0.7.11 + checksum: 10c0/acf7e1e0cd9e6eee42b09dda3c4cf513f10ce47d4ff8039d0b4104b571914a94284d28d7a6d650548be2a506d41da6ddd67eecdbfb87dddefaf146e1e9fecd22 + languageName: node + linkType: hard + +"@devframes/json-render@npm:^0.7.11": + version: 0.7.11 + resolution: "@devframes/json-render@npm:0.7.11" + dependencies: + "@json-render/core": "npm:^0.19.0" + nostics: "npm:^1.2.0" + zod: "npm:^4.3.6" + peerDependencies: + "@devframes/hub": 0.7.11 + devframe: 0.7.11 + peerDependenciesMeta: + "@devframes/hub": + optional: true + checksum: 10c0/79f3caade4d5fa0b1a8a80ce70a239ccdcc38b67af520fe2495d4ed40ed547cd54cb27840dda7ce7ce01909a64554a5bbe56a2a33172e067348b9fab6e0cff5d languageName: node linkType: hard @@ -1981,17 +2000,7 @@ __metadata: languageName: node linkType: hard -"@emnapi/core@npm:1.10.0": - version: 1.10.0 - resolution: "@emnapi/core@npm:1.10.0" - dependencies: - "@emnapi/wasi-threads": "npm:1.2.1" - tslib: "npm:^2.4.0" - checksum: 10c0/f51d08227857b60632de7714d708124f0e100a1462dde6df8221760939aa3204a73193830371830fac0716f3ccd2129f2cac1b17cd7d7958bc4da9018a296edb - languageName: node - linkType: hard - -"@emnapi/core@npm:1.11.1, @emnapi/core@npm:^1.4.3": +"@emnapi/core@npm:1.11.1": version: 1.11.1 resolution: "@emnapi/core@npm:1.11.1" dependencies: @@ -2001,16 +2010,17 @@ __metadata: languageName: node linkType: hard -"@emnapi/runtime@npm:1.10.0": - version: 1.10.0 - resolution: "@emnapi/runtime@npm:1.10.0" +"@emnapi/core@npm:1.11.2, @emnapi/core@npm:^1.4.3": + version: 1.11.2 + resolution: "@emnapi/core@npm:1.11.2" dependencies: + "@emnapi/wasi-threads": "npm:1.2.2" tslib: "npm:^2.4.0" - checksum: 10c0/953f14991d1aefb92ee6f8eb27dea725e484791a53a0cb5f47d9e0087b9a2c929ff2e92adf95af15d6ad456db6300c6b761ebf72b50a875b874a83520b3ba093 + checksum: 10c0/424ca1607f498e524eb58db1095e6cc2082986edfd84a74b116d4e2c6e43b5e9d557ea7f0d7b9adf7f6d5023e25ac2ed6bd08caf0043d3d8602598d79579c2cd languageName: node linkType: hard -"@emnapi/runtime@npm:1.11.1, @emnapi/runtime@npm:^1.4.3": +"@emnapi/runtime@npm:1.11.1": version: 1.11.1 resolution: "@emnapi/runtime@npm:1.11.1" dependencies: @@ -2019,12 +2029,12 @@ __metadata: languageName: node linkType: hard -"@emnapi/wasi-threads@npm:1.2.1": - version: 1.2.1 - resolution: "@emnapi/wasi-threads@npm:1.2.1" +"@emnapi/runtime@npm:1.11.2, @emnapi/runtime@npm:^1.4.3": + version: 1.11.2 + resolution: "@emnapi/runtime@npm:1.11.2" dependencies: tslib: "npm:^2.4.0" - checksum: 10c0/32fcfa81ab396533b2ec1f4082b1ff779a05d9c836bbbd3f4398405b0e6814c0d9503b7993130e37bc6941dbc1ded49f55e9700ae9ca4e803bab2b5bc5deb331 + checksum: 10c0/d8d500059fe9c0864571c79ce29439c1b6fb44d7ec4ac865a2aaaa7469194e5d91ebdc820cabd37c3d373478b725a8b60771733e4743cfef41fc86d9a1f2eab0 languageName: node linkType: hard @@ -2920,6 +2930,17 @@ __metadata: languageName: node linkType: hard +"@json-render/core@npm:^0.19.0": + version: 0.19.0 + resolution: "@json-render/core@npm:0.19.0" + dependencies: + zod: "npm:^4.3.6" + peerDependencies: + zod: ^4.0.0 + checksum: 10c0/15f4224df1256b0ffe7f0a7e4b44e7e616adbfa5affc471236ad46108e9478d51ef83c2899243671bad4cf07f58643feec7a4c9caf585b47ba78c363408c2944 + languageName: node + linkType: hard + "@keyv/bigmap@npm:^1.3.1": version: 1.3.1 resolution: "@keyv/bigmap@npm:1.3.1" @@ -3167,7 +3188,7 @@ __metadata: languageName: node linkType: hard -"@napi-rs/wasm-runtime@npm:^1.1.4, @napi-rs/wasm-runtime@npm:^1.1.6": +"@napi-rs/wasm-runtime@npm:^1.1.6": version: 1.1.6 resolution: "@napi-rs/wasm-runtime@npm:1.1.6" dependencies: @@ -3281,305 +3302,161 @@ __metadata: languageName: node linkType: hard -"@oxc-parser/binding-android-arm-eabi@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-android-arm-eabi@npm:0.132.0" +"@oxc-parser/binding-android-arm-eabi@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-android-arm-eabi@npm:0.140.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@oxc-parser/binding-android-arm-eabi@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-android-arm-eabi@npm:0.139.0" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - -"@oxc-parser/binding-android-arm64@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-android-arm64@npm:0.132.0" +"@oxc-parser/binding-android-arm64@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-android-arm64@npm:0.140.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@oxc-parser/binding-android-arm64@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-android-arm64@npm:0.139.0" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - -"@oxc-parser/binding-darwin-arm64@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-darwin-arm64@npm:0.132.0" +"@oxc-parser/binding-darwin-arm64@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-darwin-arm64@npm:0.140.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@oxc-parser/binding-darwin-arm64@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-darwin-arm64@npm:0.139.0" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@oxc-parser/binding-darwin-x64@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-darwin-x64@npm:0.132.0" +"@oxc-parser/binding-darwin-x64@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-darwin-x64@npm:0.140.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@oxc-parser/binding-darwin-x64@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-darwin-x64@npm:0.139.0" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@oxc-parser/binding-freebsd-x64@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-freebsd-x64@npm:0.132.0" +"@oxc-parser/binding-freebsd-x64@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-freebsd-x64@npm:0.140.0" conditions: os=freebsd & cpu=x64 languageName: node linkType: hard -"@oxc-parser/binding-freebsd-x64@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-freebsd-x64@npm:0.139.0" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-arm-gnueabihf@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-arm-gnueabihf@npm:0.132.0" +"@oxc-parser/binding-linux-arm-gnueabihf@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-arm-gnueabihf@npm:0.140.0" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxc-parser/binding-linux-arm-gnueabihf@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-arm-gnueabihf@npm:0.139.0" +"@oxc-parser/binding-linux-arm-musleabihf@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-arm-musleabihf@npm:0.140.0" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@oxc-parser/binding-linux-arm-musleabihf@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-arm-musleabihf@npm:0.132.0" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-arm-musleabihf@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-arm-musleabihf@npm:0.139.0" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-arm64-gnu@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-arm64-gnu@npm:0.132.0" +"@oxc-parser/binding-linux-arm64-gnu@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-arm64-gnu@npm:0.140.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@oxc-parser/binding-linux-arm64-gnu@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-arm64-gnu@npm:0.139.0" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-arm64-musl@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-arm64-musl@npm:0.132.0" +"@oxc-parser/binding-linux-arm64-musl@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-arm64-musl@npm:0.140.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@oxc-parser/binding-linux-arm64-musl@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-arm64-musl@npm:0.139.0" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-ppc64-gnu@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-ppc64-gnu@npm:0.132.0" +"@oxc-parser/binding-linux-ppc64-gnu@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-ppc64-gnu@npm:0.140.0" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@oxc-parser/binding-linux-ppc64-gnu@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-ppc64-gnu@npm:0.139.0" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-riscv64-gnu@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-riscv64-gnu@npm:0.132.0" +"@oxc-parser/binding-linux-riscv64-gnu@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-riscv64-gnu@npm:0.140.0" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@oxc-parser/binding-linux-riscv64-gnu@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-riscv64-gnu@npm:0.139.0" - conditions: os=linux & cpu=riscv64 & libc=glibc - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-riscv64-musl@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-riscv64-musl@npm:0.132.0" +"@oxc-parser/binding-linux-riscv64-musl@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-riscv64-musl@npm:0.140.0" conditions: os=linux & cpu=riscv64 & libc=musl languageName: node linkType: hard -"@oxc-parser/binding-linux-riscv64-musl@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-riscv64-musl@npm:0.139.0" - conditions: os=linux & cpu=riscv64 & libc=musl - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-s390x-gnu@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-s390x-gnu@npm:0.132.0" +"@oxc-parser/binding-linux-s390x-gnu@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-s390x-gnu@npm:0.140.0" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@oxc-parser/binding-linux-s390x-gnu@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-s390x-gnu@npm:0.139.0" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-x64-gnu@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-x64-gnu@npm:0.132.0" +"@oxc-parser/binding-linux-x64-gnu@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-x64-gnu@npm:0.140.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@oxc-parser/binding-linux-x64-gnu@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-x64-gnu@npm:0.139.0" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - -"@oxc-parser/binding-linux-x64-musl@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-linux-x64-musl@npm:0.132.0" +"@oxc-parser/binding-linux-x64-musl@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-linux-x64-musl@npm:0.140.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@oxc-parser/binding-linux-x64-musl@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-linux-x64-musl@npm:0.139.0" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - -"@oxc-parser/binding-openharmony-arm64@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-openharmony-arm64@npm:0.132.0" +"@oxc-parser/binding-openharmony-arm64@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-openharmony-arm64@npm:0.140.0" conditions: os=openharmony & cpu=arm64 languageName: node linkType: hard -"@oxc-parser/binding-openharmony-arm64@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-openharmony-arm64@npm:0.139.0" - conditions: os=openharmony & cpu=arm64 - languageName: node - linkType: hard - -"@oxc-parser/binding-wasm32-wasi@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-wasm32-wasi@npm:0.132.0" +"@oxc-parser/binding-wasm32-wasi@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-wasm32-wasi@npm:0.140.0" dependencies: - "@emnapi/core": "npm:1.10.0" - "@emnapi/runtime": "npm:1.10.0" - "@napi-rs/wasm-runtime": "npm:^1.1.4" - conditions: cpu=wasm32 - languageName: node - linkType: hard - -"@oxc-parser/binding-wasm32-wasi@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-wasm32-wasi@npm:0.139.0" - dependencies: - "@emnapi/core": "npm:1.11.1" - "@emnapi/runtime": "npm:1.11.1" + "@emnapi/core": "npm:1.11.2" + "@emnapi/runtime": "npm:1.11.2" "@napi-rs/wasm-runtime": "npm:^1.1.6" conditions: cpu=wasm32 languageName: node linkType: hard -"@oxc-parser/binding-win32-arm64-msvc@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-win32-arm64-msvc@npm:0.132.0" +"@oxc-parser/binding-win32-arm64-msvc@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-win32-arm64-msvc@npm:0.140.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@oxc-parser/binding-win32-arm64-msvc@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-win32-arm64-msvc@npm:0.139.0" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@oxc-parser/binding-win32-ia32-msvc@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-win32-ia32-msvc@npm:0.132.0" +"@oxc-parser/binding-win32-ia32-msvc@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-win32-ia32-msvc@npm:0.140.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@oxc-parser/binding-win32-ia32-msvc@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-win32-ia32-msvc@npm:0.139.0" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - -"@oxc-parser/binding-win32-x64-msvc@npm:0.132.0": - version: 0.132.0 - resolution: "@oxc-parser/binding-win32-x64-msvc@npm:0.132.0" +"@oxc-parser/binding-win32-x64-msvc@npm:0.140.0": + version: 0.140.0 + resolution: "@oxc-parser/binding-win32-x64-msvc@npm:0.140.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@oxc-parser/binding-win32-x64-msvc@npm:0.139.0": - version: 0.139.0 - resolution: "@oxc-parser/binding-win32-x64-msvc@npm:0.139.0" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - -"@oxc-project/types@npm:=0.139.0, @oxc-project/types@npm:^0.139.0": +"@oxc-project/types@npm:=0.139.0": version: 0.139.0 resolution: "@oxc-project/types@npm:0.139.0" checksum: 10c0/ad57d1bee4b972ecf6784183da12ac6865edfff326bd83712fb75262b901868bc2b72d6fb502465a5f0dbaaded2910003f73365caf3821901dad565cc0b7fdf2 languageName: node linkType: hard -"@oxc-project/types@npm:^0.132.0": - version: 0.132.0 - resolution: "@oxc-project/types@npm:0.132.0" - checksum: 10c0/d0ca5e98be0b873d69e4f0f743eb35026833603dac11db9d55f2b5438251b381b886dc556fe3175a17b673f8e2073c49bde88d7e6e702aa09298c22b8b5504e1 +"@oxc-project/types@npm:^0.140.0": + version: 0.140.0 + resolution: "@oxc-project/types@npm:0.140.0" + checksum: 10c0/a00e4a7f47080c46b1ff3fa36d7b0269000f8375bec49404286bc4e7aaafe0201431e95f27d63e3e8689336540e7ac56e8d2783d3c45225e1bf1b0edb0f5d567 languageName: node linkType: hard @@ -5122,22 +4999,22 @@ __metadata: languageName: node linkType: hard -"@unhead/bundler@npm:3.1.8": - version: 3.1.8 - resolution: "@unhead/bundler@npm:3.1.8" +"@unhead/bundler@npm:3.2.3": + version: 3.2.3 + resolution: "@unhead/bundler@npm:3.2.3" dependencies: - "@vitejs/devtools-kit": "npm:^0.3.4" - magic-string: "npm:^0.30.21" - oxc-parser: "npm:^0.139.0" + "@vitejs/devtools-kit": "npm:^0.4.1" + magic-string: "npm:^1.0.0" + oxc-parser: "npm:^0.140.0" oxc-walker: "npm:^1.0.0" ufo: "npm:^1.6.4" unplugin: "npm:^3.3.0" peerDependencies: - "@unhead/cli": ^3.1.8 + "@unhead/cli": ^3.2.3 esbuild: ">=0.17.0" lightningcss: ">=1.20.0" rolldown: ">=1.0.0-beta.0" - unhead: ^3.1.8 + unhead: ^3.2.3 vite: ">=6.4.2" webpack: ">=5.0.0" peerDependenciesMeta: @@ -5153,18 +5030,18 @@ __metadata: optional: true webpack: optional: true - checksum: 10c0/8ad1222aa1e36df4d1f86dff20a64c40902c4a161697d4b77088a366633f7acec5f50ba229f3d8527edef907c462c0cbd0251392c07f541a6a35b1bf42b1d08a + checksum: 10c0/f1fabb2baddf725d9dd06401b3cfc463cd19139290d3af7c487180d6b1949f938012e319842fe9d62d0a339cb329a80d5d0f791d09a9ca1cd568c5a1880b868e languageName: node linkType: hard "@unhead/react@npm:^3.1.0": - version: 3.1.8 - resolution: "@unhead/react@npm:3.1.8" + version: 3.2.3 + resolution: "@unhead/react@npm:3.2.3" dependencies: - "@unhead/bundler": "npm:3.1.8" - magic-string: "npm:^0.30.21" + "@unhead/bundler": "npm:3.2.3" + magic-string: "npm:^1.0.0" oxc-walker: "npm:^1.0.0" - unhead: "npm:3.1.8" + unhead: "npm:3.2.3" unplugin: "npm:^3.3.0" peerDependencies: react: ">=19.2.4" @@ -5175,7 +5052,7 @@ __metadata: optional: true webpack: optional: true - checksum: 10c0/6cc72a147a4d3f5392755f3807634d409d7e6b508e33fd6c510c0ee39f4858335dd94a9409c64fa645aa8a8a08eb7d33db22cbca5b5c8ad0d246d02c267f2de1 + checksum: 10c0/352a9c7f9a1ba8990535cf9e25282cf4394bc8a995c7d53c9ccd9db2a6b30a5bbdb6f8e2d38face1dad467d7a15c23d08dc85c8f98541c5b10c246acc4ce1be9 languageName: node linkType: hard @@ -5339,30 +5216,29 @@ __metadata: languageName: node linkType: hard -"@valibot/to-json-schema@npm:^1.7.0": - version: 1.7.0 - resolution: "@valibot/to-json-schema@npm:1.7.0" +"@valibot/to-json-schema@npm:^1.7.1": + version: 1.7.1 + resolution: "@valibot/to-json-schema@npm:1.7.1" peerDependencies: valibot: ^1.4.0 - checksum: 10c0/d354217270f5855ceea547bcf696546e30075b04016757603c9e826b4395aefecbd0f8a79bea4431838b28960e09a2b7543aa5c5f8672c9abb2ab7d39354f533 + checksum: 10c0/15ef472fae3229ab0dc6860325e5c6d21e724e4edbb1794ec603bc3881925bcaf5db44b30536925141758abea155b33b640129dcbb0ddfb47414cb967a6eeae1 languageName: node linkType: hard -"@vitejs/devtools-kit@npm:^0.3.4": - version: 0.3.4 - resolution: "@vitejs/devtools-kit@npm:0.3.4" +"@vitejs/devtools-kit@npm:^0.4.1": + version: 0.4.5 + resolution: "@vitejs/devtools-kit@npm:0.4.5" dependencies: - "@devframes/hub": "npm:^0.5.4" - birpc: "npm:^4.0.0" - devframe: "npm:^0.5.4" + "@devframes/hub": "npm:^0.7.11" + "@devframes/json-render": "npm:^0.7.11" + devframe: "npm:^0.7.11" + local-pkg: "npm:^1.2.1" mlly: "npm:^1.8.2" - nostics: "npm:^1.1.4" - pathe: "npm:^2.0.3" - perfect-debounce: "npm:^2.1.0" - tinyexec: "npm:^1.2.4" + nostics: "npm:^1.2.0" + nypm: "npm:^0.6.8" peerDependencies: vite: "*" - checksum: 10c0/4bc7c57df291b0e94d6a4461a5768eb70bbe084fd58422f936c58706e925df0fa337143b9890bf9f6b74fce735b37c6c5490ca076ea9f19e8e9016d9e60fe20e + checksum: 10c0/6b1ecba4058a4557a03e2ba0cc828c09ee56e61df45fb514898574ce6ecd7968ca102cd0a7102a11d48cfd87573f30fa2fbe6545901901c545b81578322be0b0 languageName: node linkType: hard @@ -6246,13 +6122,6 @@ __metadata: languageName: node linkType: hard -"cac@npm:^7.0.0": - version: 7.0.0 - resolution: "cac@npm:7.0.0" - checksum: 10c0/e9da33cb9f0425546ae92a450d479276f9969a050fe64f5d6fedf058bdd87f22a370797fe1c158e07655fa9fc183749df7cb2037431e3772faa7bee9919fb763 - languageName: node - linkType: hard - "cacache@npm:^19.0.1": version: 19.0.1 resolution: "cacache@npm:19.0.1" @@ -6430,6 +6299,13 @@ __metadata: languageName: node linkType: hard +"citty@npm:^0.2.2": + version: 0.2.2 + resolution: "citty@npm:0.2.2" + checksum: 10c0/c896c9dcd187d2a16685706d11428dcdec9eb59aa13fe50aff7b12e1d3521f1bf434d6a5316fe75a341f8ba5ce1d2beceb84f7f261d018985a73d3f6f2a793e3 + languageName: node + linkType: hard + "classnames@npm:^2.3.2": version: 2.5.1 resolution: "classnames@npm:2.5.1" @@ -6573,6 +6449,13 @@ __metadata: languageName: node linkType: hard +"confbox@npm:^0.2.4": + version: 0.2.4 + resolution: "confbox@npm:0.2.4" + checksum: 10c0/4c36af33d9df7034300c452f7b289179264493bd0671fa81b995a0d70dc897b1d37f1af10d3ffb187f178d17ba1ed2ba167ed0f599ba3a139c271205dd553f73 + languageName: node + linkType: hard + "content-disposition@npm:^1.0.0": version: 1.0.0 resolution: "content-disposition@npm:1.0.0" @@ -6737,6 +6620,18 @@ __metadata: languageName: node linkType: hard +"crossws@npm:^0.4.10": + version: 0.4.10 + resolution: "crossws@npm:0.4.10" + peerDependencies: + srvx: ">=0.11.5" + peerDependenciesMeta: + srvx: + optional: true + checksum: 10c0/dae29657672f4d9fc964150ae4ce7c31fd065885812c86c00ee29a2843813c6f5aaf9556d91dc75fecf9c606771b709f2d1b9ed26c7fa44d374b2c23fba84114 + languageName: node + linkType: hard + "css-blank-pseudo@npm:^8.0.1": version: 8.0.1 resolution: "css-blank-pseudo@npm:8.0.1" @@ -7008,6 +6903,13 @@ __metadata: languageName: node linkType: hard +"destr@npm:^2.0.5": + version: 2.0.5 + resolution: "destr@npm:2.0.5" + checksum: 10c0/efabffe7312a45ad90d79975376be958c50069f1156b94c181199763a7f971e113bd92227c26b94a169c71ca7dbc13583b7e96e5164743969fc79e1ff153e646 + languageName: node + linkType: hard + "detect-it@npm:^4.0.1": version: 4.0.1 resolution: "detect-it@npm:4.0.1" @@ -7040,25 +6942,29 @@ __metadata: languageName: node linkType: hard -"devframe@npm:^0.5.4": - version: 0.5.4 - resolution: "devframe@npm:0.5.4" +"devframe@npm:^0.7.11": + version: 0.7.11 + resolution: "devframe@npm:0.7.11" dependencies: - "@valibot/to-json-schema": "npm:^1.7.0" + "@valibot/to-json-schema": "npm:^1.7.1" birpc: "npm:^4.0.0" - cac: "npm:^7.0.0" + crossws: "npm:^0.4.10" + destr: "npm:^2.0.5" h3: "npm:2.0.1-rc.22" mrmime: "npm:^2.0.1" - nostics: "npm:^0.2.0" + nostics: "npm:^1.2.0" pathe: "npm:^2.0.3" - valibot: "npm:^1.4.1" - ws: "npm:^8.21.0" + ufo: "npm:^1.6.4" + valibot: "npm:^1.4.2" peerDependencies: "@modelcontextprotocol/sdk": ^1.0.0 + cac: ^7.0.0 peerDependenciesMeta: "@modelcontextprotocol/sdk": optional: true - checksum: 10c0/c5651a1e1501a0f4da80c07bdad96bc8cd8d3cef05ecd2ac33fdaf42fa7a481e17d59bf1922b31e46cbc8d82c4837eefeabbc907fdadab9e9d417aeb42b6af62 + cac: + optional: true + checksum: 10c0/a84c977c4007814bd9e1bbea9f6b20a7d974490d5198dcb365a84f66638c915766c28b6a81f2b5c634c4851dd0e3fc9c7dea6cfadca2168849d7ab723b77ad2c languageName: node linkType: hard @@ -8017,6 +7923,13 @@ __metadata: languageName: node linkType: hard +"exsolve@npm:^1.0.8": + version: 1.1.0 + resolution: "exsolve@npm:1.1.0" + checksum: 10c0/38ecec58d6e4ddfe31b5e6773a0193057fcb8462e1c0959aee3c9441729b4db901f3b23af68963cb871fb3f83b46c49ed2f69e0ef6d5254951f483c68cc934e9 + languageName: node + linkType: hard + "fake-indexeddb@npm:^6.0.1": version: 6.2.5 resolution: "fake-indexeddb@npm:6.2.5" @@ -9911,6 +9824,17 @@ __metadata: languageName: node linkType: hard +"local-pkg@npm:^1.2.1": + version: 1.2.1 + resolution: "local-pkg@npm:1.2.1" + dependencies: + mlly: "npm:^1.7.4" + pkg-types: "npm:^2.3.0" + quansync: "npm:^0.2.11" + checksum: 10c0/d21ccfc2595b2eddf7369f19797533573feb06820d8b5766467902a7a54e36b3a1f2b8cc2aa4481a2ad432c8e798576eabfac2f1ec0646a8e11a68694c2ef9d4 + languageName: node + linkType: hard + "locate-path@npm:^6.0.0": version: 6.0.0 resolution: "locate-path@npm:6.0.0" @@ -10577,21 +10501,23 @@ __metadata: languageName: node linkType: hard -"nostics@npm:^0.2.0": - version: 0.2.0 - resolution: "nostics@npm:0.2.0" - dependencies: - magic-string: "npm:^0.30.21" - oxc-parser: "npm:^0.132.0" - unplugin: "npm:^3.0.0" - checksum: 10c0/38139224fb95258dcf393508beb9064783f176e834c7d8ec45f823da8b4d447afb3c3783aa00e70c7b97dd1896e2fdb4e730569ac79615b65ce6194cd54444c1 +"nostics@npm:^1.2.0": + version: 1.2.0 + resolution: "nostics@npm:1.2.0" + checksum: 10c0/fae2da4abce570a55837957a95dd93b75e3c36987015dfb6c96158844fedbc3f53421486dde3bce5d26209abc1d4250703d2166f639553204187f7209cc56cae languageName: node linkType: hard -"nostics@npm:^1.1.4": - version: 1.1.4 - resolution: "nostics@npm:1.1.4" - checksum: 10c0/297adc5af7fdd03b8a24f3a26fb6dfae7902d533815deeae72ea4a3e11e90225bd357c4a7e40726eef51026147b7d389424d5ac3ade56bc2731c4fc8b22a19ca +"nypm@npm:^0.6.8": + version: 0.6.8 + resolution: "nypm@npm:0.6.8" + dependencies: + citty: "npm:^0.2.2" + pathe: "npm:^2.0.3" + tinyexec: "npm:^1.2.4" + bin: + nypm: ./dist/cli.mjs + checksum: 10c0/2aed08d6a125c5559889ccdf67f4b4a6247aa751b6b554d2b2e92c992997127bc87bb535b7782ff328ab3275b6c5daad012e1e212de8f6d08a0e99bcb53646e6 languageName: node linkType: hard @@ -10792,31 +10718,31 @@ __metadata: languageName: node linkType: hard -"oxc-parser@npm:0, oxc-parser@npm:^0.139.0": - version: 0.139.0 - resolution: "oxc-parser@npm:0.139.0" +"oxc-parser@npm:0, oxc-parser@npm:^0.140.0": + version: 0.140.0 + resolution: "oxc-parser@npm:0.140.0" dependencies: - "@oxc-parser/binding-android-arm-eabi": "npm:0.139.0" - "@oxc-parser/binding-android-arm64": "npm:0.139.0" - "@oxc-parser/binding-darwin-arm64": "npm:0.139.0" - "@oxc-parser/binding-darwin-x64": "npm:0.139.0" - "@oxc-parser/binding-freebsd-x64": "npm:0.139.0" - "@oxc-parser/binding-linux-arm-gnueabihf": "npm:0.139.0" - "@oxc-parser/binding-linux-arm-musleabihf": "npm:0.139.0" - "@oxc-parser/binding-linux-arm64-gnu": "npm:0.139.0" - "@oxc-parser/binding-linux-arm64-musl": "npm:0.139.0" - "@oxc-parser/binding-linux-ppc64-gnu": "npm:0.139.0" - "@oxc-parser/binding-linux-riscv64-gnu": "npm:0.139.0" - "@oxc-parser/binding-linux-riscv64-musl": "npm:0.139.0" - "@oxc-parser/binding-linux-s390x-gnu": "npm:0.139.0" - "@oxc-parser/binding-linux-x64-gnu": "npm:0.139.0" - "@oxc-parser/binding-linux-x64-musl": "npm:0.139.0" - "@oxc-parser/binding-openharmony-arm64": "npm:0.139.0" - "@oxc-parser/binding-wasm32-wasi": "npm:0.139.0" - "@oxc-parser/binding-win32-arm64-msvc": "npm:0.139.0" - "@oxc-parser/binding-win32-ia32-msvc": "npm:0.139.0" - "@oxc-parser/binding-win32-x64-msvc": "npm:0.139.0" - "@oxc-project/types": "npm:^0.139.0" + "@oxc-parser/binding-android-arm-eabi": "npm:0.140.0" + "@oxc-parser/binding-android-arm64": "npm:0.140.0" + "@oxc-parser/binding-darwin-arm64": "npm:0.140.0" + "@oxc-parser/binding-darwin-x64": "npm:0.140.0" + "@oxc-parser/binding-freebsd-x64": "npm:0.140.0" + "@oxc-parser/binding-linux-arm-gnueabihf": "npm:0.140.0" + "@oxc-parser/binding-linux-arm-musleabihf": "npm:0.140.0" + "@oxc-parser/binding-linux-arm64-gnu": "npm:0.140.0" + "@oxc-parser/binding-linux-arm64-musl": "npm:0.140.0" + "@oxc-parser/binding-linux-ppc64-gnu": "npm:0.140.0" + "@oxc-parser/binding-linux-riscv64-gnu": "npm:0.140.0" + "@oxc-parser/binding-linux-riscv64-musl": "npm:0.140.0" + "@oxc-parser/binding-linux-s390x-gnu": "npm:0.140.0" + "@oxc-parser/binding-linux-x64-gnu": "npm:0.140.0" + "@oxc-parser/binding-linux-x64-musl": "npm:0.140.0" + "@oxc-parser/binding-openharmony-arm64": "npm:0.140.0" + "@oxc-parser/binding-wasm32-wasi": "npm:0.140.0" + "@oxc-parser/binding-win32-arm64-msvc": "npm:0.140.0" + "@oxc-parser/binding-win32-ia32-msvc": "npm:0.140.0" + "@oxc-parser/binding-win32-x64-msvc": "npm:0.140.0" + "@oxc-project/types": "npm:^0.140.0" dependenciesMeta: "@oxc-parser/binding-android-arm-eabi": optional: true @@ -10858,77 +10784,7 @@ __metadata: optional: true "@oxc-parser/binding-win32-x64-msvc": optional: true - checksum: 10c0/bd2b6e9e45699640789c639b8851cc15582a9b665f8bbcb2dec6aae064eb37620b6b086e444bac1ff05f5dba69a241c7fa3df60dc569240952b5fa679ec936d3 - languageName: node - linkType: hard - -"oxc-parser@npm:^0.132.0": - version: 0.132.0 - resolution: "oxc-parser@npm:0.132.0" - dependencies: - "@oxc-parser/binding-android-arm-eabi": "npm:0.132.0" - "@oxc-parser/binding-android-arm64": "npm:0.132.0" - "@oxc-parser/binding-darwin-arm64": "npm:0.132.0" - "@oxc-parser/binding-darwin-x64": "npm:0.132.0" - "@oxc-parser/binding-freebsd-x64": "npm:0.132.0" - "@oxc-parser/binding-linux-arm-gnueabihf": "npm:0.132.0" - "@oxc-parser/binding-linux-arm-musleabihf": "npm:0.132.0" - "@oxc-parser/binding-linux-arm64-gnu": "npm:0.132.0" - "@oxc-parser/binding-linux-arm64-musl": "npm:0.132.0" - "@oxc-parser/binding-linux-ppc64-gnu": "npm:0.132.0" - "@oxc-parser/binding-linux-riscv64-gnu": "npm:0.132.0" - "@oxc-parser/binding-linux-riscv64-musl": "npm:0.132.0" - "@oxc-parser/binding-linux-s390x-gnu": "npm:0.132.0" - "@oxc-parser/binding-linux-x64-gnu": "npm:0.132.0" - "@oxc-parser/binding-linux-x64-musl": "npm:0.132.0" - "@oxc-parser/binding-openharmony-arm64": "npm:0.132.0" - "@oxc-parser/binding-wasm32-wasi": "npm:0.132.0" - "@oxc-parser/binding-win32-arm64-msvc": "npm:0.132.0" - "@oxc-parser/binding-win32-ia32-msvc": "npm:0.132.0" - "@oxc-parser/binding-win32-x64-msvc": "npm:0.132.0" - "@oxc-project/types": "npm:^0.132.0" - dependenciesMeta: - "@oxc-parser/binding-android-arm-eabi": - optional: true - "@oxc-parser/binding-android-arm64": - optional: true - "@oxc-parser/binding-darwin-arm64": - optional: true - "@oxc-parser/binding-darwin-x64": - optional: true - "@oxc-parser/binding-freebsd-x64": - optional: true - "@oxc-parser/binding-linux-arm-gnueabihf": - optional: true - "@oxc-parser/binding-linux-arm-musleabihf": - optional: true - "@oxc-parser/binding-linux-arm64-gnu": - optional: true - "@oxc-parser/binding-linux-arm64-musl": - optional: true - "@oxc-parser/binding-linux-ppc64-gnu": - optional: true - "@oxc-parser/binding-linux-riscv64-gnu": - optional: true - "@oxc-parser/binding-linux-riscv64-musl": - optional: true - "@oxc-parser/binding-linux-s390x-gnu": - optional: true - "@oxc-parser/binding-linux-x64-gnu": - optional: true - "@oxc-parser/binding-linux-x64-musl": - optional: true - "@oxc-parser/binding-openharmony-arm64": - optional: true - "@oxc-parser/binding-wasm32-wasi": - optional: true - "@oxc-parser/binding-win32-arm64-msvc": - optional: true - "@oxc-parser/binding-win32-ia32-msvc": - optional: true - "@oxc-parser/binding-win32-x64-msvc": - optional: true - checksum: 10c0/f3a4c5b8e19bed6a7dac19f19c0d94e84f9969f7c93f57e8b7713351a68c7d0378fc9e29c6afbecd41ce93cf5c18bb216959ba495c2d13bd53b82007eaa58b70 + checksum: 10c0/7cd9656581e98686567ee860e08ff2ce213a52cc5067a9ce2da7d58b9dbab4c1cff1e6382f22d3774013417932c2b931ad5c11e888b4c5a653efe8c3c8b5f0d0 languageName: node linkType: hard @@ -11415,6 +11271,17 @@ __metadata: languageName: node linkType: hard +"pkg-types@npm:^2.3.0": + version: 2.3.1 + resolution: "pkg-types@npm:2.3.1" + dependencies: + confbox: "npm:^0.2.4" + exsolve: "npm:^1.0.8" + pathe: "npm:^2.0.3" + checksum: 10c0/dd9b20682426abaddcac9dc786aa22542e12df15a03dea2afa7bf54da0933358c6c7f545c0c3c1c7b24a2904ab4a451bf4e34a50c6837e458359eea30c257ed4 + languageName: node + linkType: hard + "playwright-core@npm:1.61.1": version: 1.61.1 resolution: "playwright-core@npm:1.61.1" @@ -12105,6 +11972,13 @@ __metadata: languageName: node linkType: hard +"quansync@npm:^0.2.11": + version: 0.2.11 + resolution: "quansync@npm:0.2.11" + checksum: 10c0/cb9a1f8ebce074069f2f6a78578873ffedd9de9f6aa212039b44c0870955c04a71c3b1311b5d97f8ac2f2ec476de202d0a5c01160cb12bc0a11b7ef36d22ef56 + languageName: node + linkType: hard + "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -13985,7 +13859,7 @@ __metadata: languageName: node linkType: hard -"tinyexec@npm:^1.0.2, tinyexec@npm:^1.1.2, tinyexec@npm:^1.2.2, tinyexec@npm:^1.2.4": +"tinyexec@npm:^1.0.2, tinyexec@npm:^1.1.2, tinyexec@npm:^1.2.4": version: 1.2.4 resolution: "tinyexec@npm:1.2.4" checksum: 10c0/153b8db6b080194b558ff145b9cffc36b80a6e07babd644dcfbe49c807eee668c876049d28bdee90b96304476f883352f2dad91b3f86bc23832532f4363e66ff @@ -14391,9 +14265,9 @@ __metadata: languageName: node linkType: hard -"unhead@npm:3.1.8": - version: 3.1.8 - resolution: "unhead@npm:3.1.8" +"unhead@npm:3.2.3": + version: 3.2.3 + resolution: "unhead@npm:3.2.3" dependencies: hookable: "npm:^6.1.1" unplugin: "npm:^3.3.0" @@ -14402,7 +14276,7 @@ __metadata: peerDependenciesMeta: vite: optional: true - checksum: 10c0/bd4910e79a97d987575bebfd4d8a9f12c3d2d66a8d60315d1abba7561996ead4eb3a5e17c845ccead082df9fb1dd4a0ebcd4791282b035b4ef8be1d8f6bda1b0 + checksum: 10c0/500e516594d10eac29a1871f18a4d398d482615b1d2c3f0269117a35b12b16041a6d3174fe3103762bcd64cecca2b786359f79193e009336b64c2f276571c853 languageName: node linkType: hard @@ -14697,15 +14571,15 @@ __metadata: languageName: node linkType: hard -"valibot@npm:^1.4.1": - version: 1.4.1 - resolution: "valibot@npm:1.4.1" +"valibot@npm:^1.4.2": + version: 1.4.2 + resolution: "valibot@npm:1.4.2" peerDependencies: typescript: ">=5" peerDependenciesMeta: typescript: optional: true - checksum: 10c0/8a492d9c6d21032abea4fa29eafa355e5c31f1df6a3ba4b207abf20433c00b66b30884f60b225c3348113a327f20bb19e01e9b7771663e462cf94398ff39d233 + checksum: 10c0/71b861de928fd5533b03fc4d84c619c07602f176d2bc6b12c5c80b2a6e889574c4126c843dd0771ce450bbb29566ca6df13d5b538ce5e4c39c2fccfb7623cf4e languageName: node linkType: hard @@ -15117,7 +14991,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.12.1, ws@npm:^8.18.0, ws@npm:^8.19.0, ws@npm:^8.21.0": +"ws@npm:^8.12.1, ws@npm:^8.18.0, ws@npm:^8.19.0": version: 8.21.1 resolution: "ws@npm:8.21.1" peerDependencies: @@ -15273,6 +15147,13 @@ __metadata: languageName: node linkType: hard +"zigpty@npm:^0.2.1": + version: 0.2.1 + resolution: "zigpty@npm:0.2.1" + checksum: 10c0/42d53c63b5f2ac363cc7af230de31a2f0fe5edc5e5cc44b3f16c038d60645e3e57ff4b0846105e161f3fed7c8919b9571aa4a2ffdf96640c6e825d10daea9dcd + languageName: node + linkType: hard + "zlibjs@npm:^0.3.1": version: 0.3.1 resolution: "zlibjs@npm:0.3.1" @@ -15289,9 +15170,9 @@ __metadata: languageName: node linkType: hard -"zod@npm:^3.25.0 || ^4.0.0": - version: 4.1.12 - resolution: "zod@npm:4.1.12" - checksum: 10c0/b64c1feb19e99d77075261eaf613e0b2be4dfcd3551eff65ad8b4f2a079b61e379854d066f7d447491fcf193f45babd8095551a9d47973d30b46b6d8e2c46774 +"zod@npm:^3.25.0 || ^4.0.0, zod@npm:^4.3.6": + version: 4.4.3 + resolution: "zod@npm:4.4.3" + checksum: 10c0/7ea31b558e88f9faf44f31dd185e2e1cbf51fed3081787fb96cc2534749b50c0acfc6da7f0922a7353ed092dd358c7d50c28ea96c94d04af64191bd33152eca3 languageName: node linkType: hard From 9748bcfe233a9701525c8649f27241154c6ecb8e Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 28 Jul 2026 11:53:05 +0200 Subject: [PATCH 15/20] Fix remote users not being re-followed after URI change (#39861) --- app/services/activitypub/process_account_service.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 4e5597f6b4..3cf12d45a7 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -57,6 +57,7 @@ class ActivityPub::ProcessAccountService < BaseService @old_public_keys = @account.present? ? (@account.keypairs.pluck(:public_key) + [@account.public_key.presence].compact) : [] @old_protocol = @account&.protocol @suspension_changed = false + @uri_changed = @account.present? && @account.uri != @uri if @account.nil? with_redis do |redis| @@ -82,9 +83,7 @@ class ActivityPub::ProcessAccountService < BaseService end after_protocol_change! if protocol_changed? - - # TODO: extend this to an identity change, and do this on `uri` change as well - after_key_change! if all_public_keys_changed? && !signed_with_known_key + after_identity_change! if @uri_changed || (!signed_with_known_key && all_public_keys_changed?) # TODO: maybe tie tombstones to specific keys? i.e. we don't need to keep tombstones if all keys changed clear_tombstones! if all_public_keys_changed? @@ -300,7 +299,7 @@ class ActivityPub::ProcessAccountService < BaseService ActivityPub::PostUpgradeWorker.perform_async(@account.domain) end - def after_key_change! + def after_identity_change! RefollowWorker.perform_async(@account.id) end From 178f1dfb4ea6262649f03c5050176097a87c6288 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 28 Jul 2026 15:46:33 +0200 Subject: [PATCH 16/20] Add documentation for new signature schemes to FEDERATION.md (#39735) --- FEDERATION.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/FEDERATION.md b/FEDERATION.md index 22bbb03a0c..8779364219 100644 --- a/FEDERATION.md +++ b/FEDERATION.md @@ -15,6 +15,8 @@ - [FEP-5feb: Search indexing consent for actors](https://codeberg.org/fediverse/fep/src/branch/main/fep/5feb/fep-5feb.md) - [FEP-044f: Consent-respecting quote posts](https://codeberg.org/fediverse/fep/src/branch/main/fep/044f/fep-044f.md) - [FEP-3b86: Activity Intents](https://codeberg.org/fediverse/fep/src/branch/main/fep/3b86/fep-3b86.md): offer handlers for `Object` and `Create` (with support for the `content` parameter only), has support for the `Follow`, `Announce`, `Like` and `Object` intents +- [FEP-521a: Representing actor's public keys](https://codeberg.org/fediverse/fep/src/branch/main/fep/521a/fep-521a.md): starting with Mastodon 4.7, we support RSA and Ed25519 keys exposed through FEP-521a, but we do not expose our keys this way +- [FEP-8b32: Object Integrity Proofs](https://codeberg.org/fediverse/fep/src/branch/main/fep/8b32/fep-8b32.md): starting with Mastodon 4.7, we support top-level Object Integrity Proofs using the `eddsa-jcs-2022` cryptosuite, but we do not emit any Object Integrity Proof ## ActivityPub in Mastodon @@ -39,13 +41,36 @@ In order to authenticate activities, Mastodon relies on HTTP Signatures, signing Mastodon requires all `POST` requests to be signed, and MAY require `GET` requests to be signed, depending on the configuration of the Mastodon server. +Before Mastodon v4.5.0, Mastodon only supported HTTP Signatures such as defined in the [draft-cavage-http-signatures-12](https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures) specification draft. + +Starting with Mastodon v4.5.0, Mastodon supports requests signed using HTTP Message Signatures (RFC9421) with the [`rsa-v1_5-sha256` algorithm](https://datatracker.ietf.org/doc/html/rfc9421#name-rsassa-pkcs1-v1_5-using-sha) in addition to the old `draft-cavage-http-signatures-12` draft. Mastodon v4.7 also supports verifying signatures using the [`ed25519` algorithm](https://datatracker.ietf.org/doc/html/rfc9421#name-eddsa-using-curve-edwards25), and uses RFC 9421 in outbound requests when `draft-cavage-http-signatures-12` requests are met with a 400 or 401 error code. + +| Mastodon version | Support for `draft-cavage-http-signatures-12` | Support for RFC 9421 | +| ----------------------- | --------------------------------------------- | --------------------------------------------------------------------------------- | +| v4.4.0 (EOL 2026-12-17) | `rsa-sha256` inbound and outbound | No | +| v4.5.0 | `rsa-sha256` inbound and outbound | `rsa-v1_5-sha256` inbound | +| v4.6.0 | `rsa-sha256` inbound and outbound | `rsa-v1_5-sha256` inbound | +| v4.7.0 (unreleased) | `rsa-sha256` inbound and outbound | `rsa-v1_5-sha256` and `ed25519` inbound, `rsa-v1_5-sha256` outbound as a fallback | + - [HTTP Signatures information and examples](https://docs.joinmastodon.org/spec/security/#http) +- [HTTP Message Signatures information and examples](https://docs.joinmastodon.org/spec/security/#http-message-signatures) ### Optional extensions - [Linked-Data Signatures](https://docs.joinmastodon.org/spec/security/#ld) - [Bearcaps](https://docs.joinmastodon.org/spec/bearcaps/) +#### Embedded signatures + +Mastodon supports embedded signatures through either [Linked-Data Signatures](https://docs.joinmastodon.org/spec/security/#ld) or [Object Integrity Proofs](https://docs.joinmastodon.org/spec/security/#fep-8b32). + +| Mastodon version | Support for Linked Data Signatures | Support FEP-8b32: Object Integrity Proofs | +| ----------------------- | --------------------------------------- | -------------------------------------------------------- | +| v4.4.0 (EOL 2026-12-17) | `RsaSignature2017` inbound and outbound | No | +| v4.5.0 | `RsaSignature2017` inbound and outbound | No | +| v4.6.0 | `RsaSignature2017` inbound and outbound | No | +| v4.7.0 (unreleased) | `RsaSignature2017` inbound and outbound | top-level `eddsa-jcs-2022` or `mldsa44-jcs-2024` inbound | + ### Additional documentation - [Mastodon documentation](https://docs.joinmastodon.org/) From 857db1913e8c5929fd60ad9085eb013dbe0af315 Mon Sep 17 00:00:00 2001 From: Sharlayan <118798881+sharlayan@users.noreply.github.com> Date: Tue, 28 Jul 2026 22:49:32 +0900 Subject: [PATCH 17/20] Fix oversized profile image crop uploads (#39958) --- .../features/account_edit/modals/image_upload.tsx | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/app/javascript/mastodon/features/account_edit/modals/image_upload.tsx b/app/javascript/mastodon/features/account_edit/modals/image_upload.tsx index e63ac427c2..db641ff1c0 100644 --- a/app/javascript/mastodon/features/account_edit/modals/image_upload.tsx +++ b/app/javascript/mastodon/features/account_edit/modals/image_upload.tsx @@ -94,12 +94,12 @@ export const ImageUploadModal: FC< setStep('select'); return; } - void calculateCroppedImage(imageSrc, crop).then((blob) => { + void calculateCroppedImage(imageSrc, crop, location).then((blob) => { setImageBlob(blob); setStep('alt'); }); }, - [imageSrc], + [imageSrc, location], ); const dispatch = useAppDispatch(); @@ -418,9 +418,14 @@ const StepAlt: FC<{ async function calculateCroppedImage( imageSrc: string, crop: Area, + location: ImageLocation, ): Promise { const image = await dataUriToImage(imageSrc); - const canvas = new OffscreenCanvas(crop.width, crop.height); + const maxWidth = location === 'avatar' ? 400 : 1500; + const scale = Math.min(1, maxWidth / crop.width); + const width = Math.round(crop.width * scale); + const height = Math.round(crop.height * scale); + const canvas = new OffscreenCanvas(width, height); const ctx = canvas.getContext('2d'); if (!ctx) { throw new Error('Failed to get canvas context'); @@ -437,8 +442,8 @@ async function calculateCroppedImage( crop.height, 0, 0, - crop.width, - crop.height, + width, + height, ); return canvas.convertToBlob(); From 7d36211f88c72bac9e2f3360fef132b5249952e2 Mon Sep 17 00:00:00 2001 From: David Roetzel Date: Tue, 28 Jul 2026 15:52:21 +0200 Subject: [PATCH 18/20] Add another permission check to admin area (#39974) --- app/controllers/admin/base_controller.rb | 6 +++ app/policies/admin/base_policy.rb | 7 +++ spec/policies/admin/base_policy_spec.rb | 60 ++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 app/policies/admin/base_policy.rb create mode 100644 spec/policies/admin/base_policy_spec.rb diff --git a/app/controllers/admin/base_controller.rb b/app/controllers/admin/base_controller.rb index 14338dd293..42965696da 100644 --- a/app/controllers/admin/base_controller.rb +++ b/app/controllers/admin/base_controller.rb @@ -7,6 +7,7 @@ module Admin layout 'admin' + before_action :require_moderator_or_admin_permissions before_action :set_referrer_policy_header after_action :verify_authorized @@ -20,5 +21,10 @@ module Admin def set_user @user = Account.find(params[:account_id]).user || raise(ActiveRecord::RecordNotFound) end + + def require_moderator_or_admin_permissions + # not using #authorize here, so #verify_authorized still makes sure more fine-grained rules are enforced down the line + forbidden unless Admin::BasePolicy.new(current_account, :base).access? + end end end diff --git a/app/policies/admin/base_policy.rb b/app/policies/admin/base_policy.rb new file mode 100644 index 0000000000..77a458c0a6 --- /dev/null +++ b/app/policies/admin/base_policy.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class Admin::BasePolicy < ApplicationPolicy + def access? + role.administrator? || role.can?(*UserRole::Flags::CATEGORIES.fetch_values(:moderation, :administration, :devops).flatten) + end +end diff --git a/spec/policies/admin/base_policy_spec.rb b/spec/policies/admin/base_policy_spec.rb new file mode 100644 index 0000000000..3cd89d38be --- /dev/null +++ b/spec/policies/admin/base_policy_spec.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe Admin::BasePolicy do + let(:policy) { described_class } + let(:custom_devops_role) do + Fabricate(:user_role, permissions_as_keys: [:view_devops]) + end + let(:custom_role_with_one_admin_permission) do + Fabricate(:user_role, permissions_as_keys: [:manage_announcements]) + end + let(:custom_role_with_one_moderator_permission) do + Fabricate(:user_role, permissions_as_keys: [:manage_invites]) + end + let(:admin) { Fabricate(:admin_user).account } + let(:moderator) { Fabricate(:moderator_user).account } + let(:devops_user) { Fabricate(:user, role: custom_devops_role).account } + let(:custom_admin) { Fabricate(:user, role: custom_role_with_one_admin_permission).account } + let(:custom_moderator) { Fabricate(:user, role: custom_role_with_one_moderator_permission).account } + let(:regular_user) { Fabricate(:account) } + + permissions :access? do + context 'with an admin' do + it 'permits' do + expect(policy).to permit(admin, :base) + end + end + + context 'with a moderator' do + it 'permits' do + expect(policy).to permit(moderator, :base) + end + end + + context 'with a user with devops permissions' do + it 'permits' do + expect(policy).to permit(devops_user, :base) + end + end + + context 'with a user with a custom role that grants a single admin permission' do + it 'permits' do + expect(policy).to permit(custom_admin, :base) + end + end + + context 'with a user with a custom role that grants a single moderator permission' do + it 'permits' do + expect(policy).to permit(custom_moderator, :base) + end + end + + context 'with a non-admin' do + it 'denies' do + expect(policy).to_not permit(regular_user, :base) + end + end + end +end From 165613d2a6110b7500cdb24f4e5bb4313f0de2f6 Mon Sep 17 00:00:00 2001 From: Echo Date: Tue, 28 Jul 2026 15:55:14 +0200 Subject: [PATCH 19/20] Redesign components: Radio buttons (#39943) --- .../components/button/redesign.module.scss | 15 ++-- .../components/form_fields/checkbox_field.tsx | 30 ++++---- .../components/form_fields/combobox_field.tsx | 11 ++- .../form_fields/copy_link_field.tsx | 13 +++- .../components/form_fields/fieldset.tsx | 12 ++-- .../form_fields/form_field_wrapper.tsx | 6 +- .../form_fields/radio_button_field.tsx | 71 +++++++++++-------- .../form_fields/redesign.module.scss | 36 ++++++++++ .../form_fields/redesign.stories.tsx | 16 ++++- .../components/form_fields/redesign.tsx | 30 ++++++++ .../components/form_fields/toggle_field.tsx | 30 ++++---- 11 files changed, 197 insertions(+), 73 deletions(-) diff --git a/app/javascript/mastodon/components/button/redesign.module.scss b/app/javascript/mastodon/components/button/redesign.module.scss index 8dd6ab90a8..a504108713 100644 --- a/app/javascript/mastodon/components/button/redesign.module.scss +++ b/app/javascript/mastodon/components/button/redesign.module.scss @@ -139,9 +139,10 @@ a.base { // Helper classes -.icon { - width: 1em; - height: 1em; +.icon, +.loading { + width: var(--fs-xl); + height: var(--fs-xl); } // Adds padding to the text label. This is supposed to be there even if there is no icon. @@ -156,15 +157,9 @@ a.base { .iconOnly { aspect-ratio: 1; + padding: 0; } .loading { color: inherit; - height: 0.8em; - width: 0.8em; - - .iconOnly & { - height: 1em; - width: 1em; - } } diff --git a/app/javascript/mastodon/components/form_fields/checkbox_field.tsx b/app/javascript/mastodon/components/form_fields/checkbox_field.tsx index 78bbb32e4f..47e4c7051b 100644 --- a/app/javascript/mastodon/components/form_fields/checkbox_field.tsx +++ b/app/javascript/mastodon/components/form_fields/checkbox_field.tsx @@ -13,18 +13,24 @@ type Props = Omit, 'type'> & { export const CheckboxField = forwardRef< HTMLInputElement, Props & CommonFieldWrapperProps ->(({ id, label, hint, status, required, ...otherProps }, ref) => ( - - {(inputProps) => } - -)); +>( + ( + { id, label, hint, status, required, wrapperClassName, ...otherProps }, + ref, + ) => ( + + {(inputProps) => } + + ), +); CheckboxField.displayName = 'CheckboxField'; diff --git a/app/javascript/mastodon/components/form_fields/combobox_field.tsx b/app/javascript/mastodon/components/form_fields/combobox_field.tsx index 9c93d3f4f1..b92fdb9e89 100644 --- a/app/javascript/mastodon/components/form_fields/combobox_field.tsx +++ b/app/javascript/mastodon/components/form_fields/combobox_field.tsx @@ -180,7 +180,15 @@ export const ComboboxFieldWithRef = < Item extends ComboboxItem, GroupKey extends string, >( - { id, label, hint, status, required, ...otherProps }: Props, + { + id, + label, + hint, + status, + required, + wrapperClassName, + ...otherProps + }: Props, ref: React.ForwardedRef, ) => ( {(inputProps) => } diff --git a/app/javascript/mastodon/components/form_fields/copy_link_field.tsx b/app/javascript/mastodon/components/form_fields/copy_link_field.tsx index 062a9074a3..0476afe644 100644 --- a/app/javascript/mastodon/components/form_fields/copy_link_field.tsx +++ b/app/javascript/mastodon/components/form_fields/copy_link_field.tsx @@ -22,7 +22,17 @@ interface CopyLinkFieldProps extends CommonFieldWrapperProps, TextInputProps { export const CopyLinkField = forwardRef( ( - { id, label, hint, status, value, required, className, ...otherProps }, + { + id, + label, + hint, + status, + value, + required, + className, + wrapperClassName, + ...otherProps + }, ref, ) => { const intl = useIntl(); @@ -50,6 +60,7 @@ export const CopyLinkField = forwardRef( required={required} status={status} inputId={id} + className={wrapperClassName} > {(inputProps) => (
diff --git a/app/javascript/mastodon/components/form_fields/fieldset.tsx b/app/javascript/mastodon/components/form_fields/fieldset.tsx index 06882d8e81..02ee92cf0d 100644 --- a/app/javascript/mastodon/components/form_fields/fieldset.tsx +++ b/app/javascript/mastodon/components/form_fields/fieldset.tsx @@ -3,6 +3,8 @@ import type { ReactNode, FC } from 'react'; import { createContext, useId } from 'react'; +import classNames from 'classnames'; + import { A11yLiveRegion } from 'mastodon/components/a11y_live_region'; import { CalloutInline } from 'mastodon/components/callout_inline'; @@ -17,6 +19,7 @@ interface FieldsetProps { name?: string; status?: FieldStatus | FieldStatus['variant']; layout?: 'vertical' | 'horizontal'; + className?: string; children: ReactNode; } @@ -33,6 +36,7 @@ export const Fieldset: FC = ({ name, status, layout, + className, children, }) => { const uniqueId = useId(); @@ -54,23 +58,23 @@ export const Fieldset: FC = ({ return (
-
+
{legend}
{hasHint && ( -

+

{hint}

)}
-
+
{children} diff --git a/app/javascript/mastodon/components/form_fields/form_field_wrapper.tsx b/app/javascript/mastodon/components/form_fields/form_field_wrapper.tsx index 579d6e814c..841247373b 100644 --- a/app/javascript/mastodon/components/form_fields/form_field_wrapper.tsx +++ b/app/javascript/mastodon/components/form_fields/form_field_wrapper.tsx @@ -83,7 +83,9 @@ export const FormFieldWrapper: FC = ({ }; const input = ( -
{children(inputProps)}
+
+ {children(inputProps)} +
); return ( @@ -105,7 +107,7 @@ export const FormFieldWrapper: FC = ({ {hasHint && ( - + {hint} )} diff --git a/app/javascript/mastodon/components/form_fields/radio_button_field.tsx b/app/javascript/mastodon/components/form_fields/radio_button_field.tsx index cbc9020ca7..a16bf8a3db 100644 --- a/app/javascript/mastodon/components/form_fields/radio_button_field.tsx +++ b/app/javascript/mastodon/components/form_fields/radio_button_field.tsx @@ -3,6 +3,8 @@ import type { ComponentPropsWithoutRef, CSSProperties } from 'react'; import { forwardRef, useContext } from 'react'; +import classNames from 'classnames'; + import { FieldsetNameContext } from './fieldset'; import type { CommonFieldWrapperProps } from './form_field_wrapper'; import { FormFieldWrapper } from './form_field_wrapper'; @@ -15,41 +17,50 @@ type Props = Omit, 'type'> & { export const RadioButtonField = forwardRef< HTMLInputElement, Props & CommonFieldWrapperProps ->(({ id, label, hint, status, required, ...otherProps }, ref) => { - const fieldsetName = useContext(FieldsetNameContext); +>( + ( + { id, label, hint, status, required, wrapperClassName, ...otherProps }, + ref, + ) => { + const fieldsetName = useContext(FieldsetNameContext); - return ( - - {(inputProps) => ( - - )} - - ); -}); + return ( + + {(inputProps) => ( + + )} + + ); + }, +); RadioButtonField.displayName = 'RadioButtonField'; export const RadioButton = forwardRef( - ({ className, size, ...otherProps }, ref) => ( - + ({ className, size, children, ...otherProps }, ref) => ( + <> + {children} + + ), ); diff --git a/app/javascript/mastodon/components/form_fields/redesign.module.scss b/app/javascript/mastodon/components/form_fields/redesign.module.scss index 87337e3af1..af0d9c1ad2 100644 --- a/app/javascript/mastodon/components/form_fields/redesign.module.scss +++ b/app/javascript/mastodon/components/form_fields/redesign.module.scss @@ -1,3 +1,39 @@ +// Radio + +.radioWrapper { + [data-input] { + position: relative; + } + + .icon { + position: absolute; + pointer-events: none; + opacity: 0; + transition: + color 200ms, + opacity 200ms; + } + + .icon:has(+ :checked) { + opacity: 1; + } + + input { + opacity: 0; + } + + label { + font-size: var(--fs-sm); + } +} + +.icon { + width: var(--fs-lg); + height: var(--fs-lg); +} + +// Text Input + .inputWrapper { label { font-size: var(--fs-sm); diff --git a/app/javascript/mastodon/components/form_fields/redesign.stories.tsx b/app/javascript/mastodon/components/form_fields/redesign.stories.tsx index a8b45e3fff..6ab651a453 100644 --- a/app/javascript/mastodon/components/form_fields/redesign.stories.tsx +++ b/app/javascript/mastodon/components/form_fields/redesign.stories.tsx @@ -1,6 +1,9 @@ import type { Meta, StoryObj } from '@storybook/react-vite'; -import { TextInputField, ToggleField } from './redesign'; +import CheckIcon from '@/material-icons/400-24px/check.svg?react'; + +import { Fieldset } from './fieldset'; +import { RadioButtonField, TextInputField, ToggleField } from './redesign'; interface FieldProps { label: string; @@ -28,6 +31,17 @@ export default meta; type Story = StoryObj; +export const RadioButton: Story = { + render(args) { + return ( +
+ + +
+ ); + }, +}; + export const TextInput: Story = { render(args) { return ; diff --git a/app/javascript/mastodon/components/form_fields/redesign.tsx b/app/javascript/mastodon/components/form_fields/redesign.tsx index e2f00456dd..7d5ecd4e59 100644 --- a/app/javascript/mastodon/components/form_fields/redesign.tsx +++ b/app/javascript/mastodon/components/form_fields/redesign.tsx @@ -2,6 +2,10 @@ import classNames from 'classnames'; import type { Merge } from 'type-fest'; +import { Icon } from '../icon'; +import type { IconProp } from '../icon'; + +import { RadioButtonField as OldRadioButtonField } from './radio_button_field'; import classes from './redesign.module.scss'; import { TextInput as OldTextInput, @@ -18,6 +22,31 @@ type RedesignComponent< P = object, > = React.FC, P>>; +// Radio button field + +interface RadioButtonProps { + icon?: IconProp | null; + iconClassName?: string; +} + +export const RadioButtonField: RedesignComponent< + typeof OldRadioButtonField, + RadioButtonProps +> = ({ icon, iconClassName, wrapperClassName, ...props }) => ( + + {icon && ( + + )} + +); + // Text field export const TextInputField: RedesignComponent = ({ @@ -71,5 +100,6 @@ export const ToggleField: RedesignComponent< classes.toggle, size === 'sm' && classes.toggleSmall, )} + size={size === 'sm' ? 14 : 20} /> ); diff --git a/app/javascript/mastodon/components/form_fields/toggle_field.tsx b/app/javascript/mastodon/components/form_fields/toggle_field.tsx index 3de09823d3..ea995305dd 100644 --- a/app/javascript/mastodon/components/form_fields/toggle_field.tsx +++ b/app/javascript/mastodon/components/form_fields/toggle_field.tsx @@ -14,18 +14,24 @@ type Props = Omit, 'type'> & { export const ToggleField = forwardRef< HTMLInputElement, Props & CommonFieldWrapperProps ->(({ id, label, hint, status, required, ...otherProps }, ref) => ( - - {(inputProps) => } - -)); +>( + ( + { id, label, hint, status, required, wrapperClassName, ...otherProps }, + ref, + ) => ( + + {(inputProps) => } + + ), +); ToggleField.displayName = 'ToggleField'; From cd909b22c03314b1426a80b57073e563ac89f026 Mon Sep 17 00:00:00 2001 From: Echo Date: Tue, 28 Jul 2026 16:07:12 +0200 Subject: [PATCH 20/20] Redesign composer thunks (#39945) --- .../mastodon/actions/compose_typed.ts | 120 +++++++++++++++--- .../compose/components/language_dropdown.tsx | 2 +- .../containers/compose_form_container.js | 3 +- .../mastodon/features/compose/index.tsx | 5 +- .../components/column_settings.tsx | 5 - .../components/inline_follow_suggestions.tsx | 4 +- .../components/column_settings_group.tsx | 7 +- .../features/ui/components/columns_area.tsx | 6 +- .../private_quote_notify.tsx | 3 +- .../ui/components/skip_links/index.tsx | 2 +- app/javascript/mastodon/reducers/settings.js | 1 + app/javascript/mastodon/selectors/settings.ts | 7 +- 12 files changed, 123 insertions(+), 42 deletions(-) diff --git a/app/javascript/mastodon/actions/compose_typed.ts b/app/javascript/mastodon/actions/compose_typed.ts index 310ac5f84d..2cc4526b82 100644 --- a/app/javascript/mastodon/actions/compose_typed.ts +++ b/app/javascript/mastodon/actions/compose_typed.ts @@ -3,24 +3,32 @@ import { defineMessages } from 'react-intl'; import { createAction } from '@reduxjs/toolkit'; import type { List as ImmutableList, Map as ImmutableMap } from 'immutable'; -import { apiUpdateMedia } from 'mastodon/api/compose'; -import { apiGetSearch } from 'mastodon/api/search'; -import type { ApiMediaAttachmentJSON } from 'mastodon/api_types/media_attachments'; -import type { MediaAttachment } from 'mastodon/models/media_attachment'; +import { apiUpdateMedia } from '@/mastodon/api/compose'; +import { apiGetSearch } from '@/mastodon/api/search'; +import type { ApiMediaAttachmentJSON } from '@/mastodon/api_types/media_attachments'; +import type { ApiQuotePolicy } from '@/mastodon/api_types/quotes'; +import type { MediaAttachment } from '@/mastodon/models/media_attachment'; +import type { Status, StatusVisibility } from '@/mastodon/models/status'; +import type { RootState } from '@/mastodon/store'; import { createDataLoadingThunk, createAppThunk, -} from 'mastodon/store/typed_functions'; +} from '@/mastodon/store/typed_functions'; -import type { ApiQuotePolicy } from '../api_types/quotes'; -import type { Status, StatusVisibility } from '../models/status'; -import type { RootState } from '../store'; +import type { ApiStatusJSON } from '../api_types/statuses'; import { showAlert } from './alerts'; -import { changeCompose, focusCompose } from './compose'; +import { + changeCompose, + focusCompose, + submitCompose as submitComposeApi, + uploadCompose, +} from './compose'; import { importFetchedStatuses } from './importer'; import { openModal } from './modal'; +export const PRIVATE_QUOTE_MODAL_ID = 'quote/private_notify'; + const messages = defineMessages({ quoteErrorEdit: { id: 'quote_error.edit', @@ -159,13 +167,11 @@ export const quoteComposeByStatus = createAppThunk( const state = getState(); const composeState = state.compose; const mediaAttachments = composeState.get('media_attachments'); - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment - const wasQuietPostHintModalDismissed: boolean = - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access - state.settings.getIn( - ['dismissed_banners', 'quote/quiet_post_hint'], - false, - ); + + const wasQuietPostHintModalDismissed = !!state.settings.getIn( + ['dismissed_banners', 'quote/quiet_post_hint'], + false, + ); if (composeState.get('id')) { dispatch(showAlert({ message: messages.quoteErrorEdit })); @@ -278,3 +284,85 @@ export const setComposeQuotePolicy = createAction( export const setDragUploadEnabled = createAction( 'compose/setDragUploadEnabled', ); + +export const submitCompose = createAppThunk( + ( + { + textareaValue = '', + redirectOnSuccess, + }: { textareaValue?: string; redirectOnSuccess?: boolean }, + { getState, dispatch }, + ) => { + if ( + textareaValue && + (getState().compose.get('text') as string) !== textareaValue + ) { + dispatch(changeCompose(textareaValue)); + } + + const { compose, meta, statuses, settings } = getState(); + const privacy = compose.get('privacy') as StatusVisibility; + const missingAltText = ( + compose.get('media_attachments') as unknown as Immutable.List< + Immutable.Map + > + ).some( + (media) => + ['image', 'gifv'].includes(media.get('type') ?? '') && + (media.get('description') ?? '').length === 0, + ); + const me = meta.get('me') as string | null; + const quotedStatusId = compose.get('quoted_status_id') as string | null; + const quoteToPrivate = + !!quotedStatusId && + privacy === 'private' && + statuses.getIn([quotedStatusId, 'account']) !== me && + !settings.getIn(['dismissed_banners', PRIVATE_QUOTE_MODAL_ID]); + + if ( + !!meta.get('missing_alt_text_modal') && + missingAltText && + privacy !== 'direct' + ) { + dispatch( + openModal({ + modalType: 'CONFIRM_MISSING_ALT_TEXT', + modalProps: {}, + }), + ); + } else if (quoteToPrivate) { + dispatch( + openModal({ + modalType: 'CONFIRM_PRIVATE_QUOTE_NOTIFY', + modalProps: {}, + }), + ); + } else { + dispatch( + submitComposeApi((status: ApiStatusJSON) => { + if (redirectOnSuccess) { + window.location.assign(status.url); + } + }), + ); + } + }, +); + +const urlLikeRegex = /^https?:\/\/[^\s]+\/[^\s]+$/i; + +export const processPasteOrDrop = createAppThunk( + (transfer: DataTransfer, { dispatch }) => { + if (transfer.files.length === 1) { + dispatch(uploadCompose(transfer.files)); + } else if (transfer.files.length === 0) { + const data = transfer.getData('text/plain'); + if (!urlLikeRegex.exec(data)) return; + + try { + const url = new URL(data).toString(); + void dispatch(pasteLinkCompose({ url })); + } catch {} + } + }, +); diff --git a/app/javascript/mastodon/features/compose/components/language_dropdown.tsx b/app/javascript/mastodon/features/compose/components/language_dropdown.tsx index c850690531..ebf577c058 100644 --- a/app/javascript/mastodon/features/compose/components/language_dropdown.tsx +++ b/app/javascript/mastodon/features/compose/components/language_dropdown.tsx @@ -38,7 +38,7 @@ type Language = [string, string, string]; const getFrequentlyUsedLanguages = createSelector( [ (state: RootState) => - (state.settings as ImmutableMap).get( + state.settings.get( 'frequentlyUsedLanguages', ImmutableMap(), ) as ImmutableMap, diff --git a/app/javascript/mastodon/features/compose/containers/compose_form_container.js b/app/javascript/mastodon/features/compose/containers/compose_form_container.js index c5cffff10d..f2b1fee849 100644 --- a/app/javascript/mastodon/features/compose/containers/compose_form_container.js +++ b/app/javascript/mastodon/features/compose/containers/compose_form_container.js @@ -10,9 +10,8 @@ import { insertEmojiCompose, uploadCompose, } from 'mastodon/actions/compose'; -import { pasteLinkCompose } from 'mastodon/actions/compose_typed'; +import { pasteLinkCompose, PRIVATE_QUOTE_MODAL_ID } from 'mastodon/actions/compose_typed'; import { openModal } from 'mastodon/actions/modal'; -import { PRIVATE_QUOTE_MODAL_ID } from 'mastodon/features/ui/components/confirmation_modals/private_quote_notify'; import { me } from 'mastodon/initial_state'; import ComposeForm from '../components/compose_form'; diff --git a/app/javascript/mastodon/features/compose/index.tsx b/app/javascript/mastodon/features/compose/index.tsx index 8d9db22470..8d9dc68cbe 100644 --- a/app/javascript/mastodon/features/compose/index.tsx +++ b/app/javascript/mastodon/features/compose/index.tsx @@ -52,10 +52,7 @@ const Compose: React.FC<{ multiColumn: boolean }> = ({ multiColumn }) => { const intl = useIntl(); const dispatch = useAppDispatch(); const columns = useAppSelector( - (state) => - (state.settings as ImmutableMap).get( - 'columns', - ) as ImmutableList, + (state) => state.settings.get('columns') as ImmutableList, ); useEffect(() => { diff --git a/app/javascript/mastodon/features/home_timeline/components/column_settings.tsx b/app/javascript/mastodon/features/home_timeline/components/column_settings.tsx index 7de82215e4..6257eae34f 100644 --- a/app/javascript/mastodon/features/home_timeline/components/column_settings.tsx +++ b/app/javascript/mastodon/features/home_timeline/components/column_settings.tsx @@ -1,8 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unsafe-call, - @typescript-eslint/no-unsafe-return, - @typescript-eslint/no-unsafe-assignment, - @typescript-eslint/no-unsafe-member-access - -- the settings store is not yet typed */ import { useCallback } from 'react'; import { FormattedMessage } from 'react-intl'; diff --git a/app/javascript/mastodon/features/home_timeline/components/inline_follow_suggestions.tsx b/app/javascript/mastodon/features/home_timeline/components/inline_follow_suggestions.tsx index e48fd19c3b..2d849b46ff 100644 --- a/app/javascript/mastodon/features/home_timeline/components/inline_follow_suggestions.tsx +++ b/app/javascript/mastodon/features/home_timeline/components/inline_follow_suggestions.tsx @@ -174,9 +174,7 @@ export const InlineFollowSuggestions: React.FC<{ hidden?: boolean }> = ({ const suggestions = useAppSelector((state) => state.suggestions.items); const isLoading = useAppSelector((state) => state.suggestions.isLoading); const dismissed = useAppSelector( - (state) => - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call - state.settings.getIn(['dismissed_banners', DISMISSIBLE_ID]) as boolean, + (state) => !!state.settings.getIn(['dismissed_banners', DISMISSIBLE_ID]), ); useEffect(() => { diff --git a/app/javascript/mastodon/features/notifications/components/column_settings_group.tsx b/app/javascript/mastodon/features/notifications/components/column_settings_group.tsx index f888488be3..57c8d0ed7e 100644 --- a/app/javascript/mastodon/features/notifications/components/column_settings_group.tsx +++ b/app/javascript/mastodon/features/notifications/components/column_settings_group.tsx @@ -18,9 +18,10 @@ import SettingToggle from './setting_toggle'; const selectNotificationSettings = createAppSelector( [ (state) => - (state.settings as Immutable.Map).get( - 'notifications', - ) as Immutable.Map | boolean>, + state.settings.get('notifications') as Immutable.Map< + string, + Immutable.Map | boolean + >, (state) => state.notifications.get('browserPermission') as string, (state) => state.push_notifications, ], diff --git a/app/javascript/mastodon/features/ui/components/columns_area.tsx b/app/javascript/mastodon/features/ui/components/columns_area.tsx index be91d5dccc..0e0d0884be 100644 --- a/app/javascript/mastodon/features/ui/components/columns_area.tsx +++ b/app/javascript/mastodon/features/ui/components/columns_area.tsx @@ -93,10 +93,8 @@ export const ColumnsArea = forwardRef< } >(({ children, minimalShell, singleColumn }, ref) => { const renderComposePanel = !useBreakpoint('full'); - const columns = useAppSelector((state) => - (state.settings as Record<{ columns: List> }>).get( - 'columns', - ), + const columns = useAppSelector( + (state) => state.settings.get('columns') as List>, ); const isModalOpen = useAppSelector( (state) => !state.modal.get('stack').isEmpty(), diff --git a/app/javascript/mastodon/features/ui/components/confirmation_modals/private_quote_notify.tsx b/app/javascript/mastodon/features/ui/components/confirmation_modals/private_quote_notify.tsx index ef917a1027..42fc15b266 100644 --- a/app/javascript/mastodon/features/ui/components/confirmation_modals/private_quote_notify.tsx +++ b/app/javascript/mastodon/features/ui/components/confirmation_modals/private_quote_notify.tsx @@ -3,6 +3,7 @@ import { forwardRef, useCallback, useState } from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; import { submitCompose } from '@/mastodon/actions/compose'; +import { PRIVATE_QUOTE_MODAL_ID } from '@/mastodon/actions/compose_typed'; import { changeSetting } from '@/mastodon/actions/settings'; import { CheckBox } from '@/mastodon/components/check_box'; import { useAppDispatch } from '@/mastodon/store'; @@ -11,8 +12,6 @@ import { ConfirmationModal } from './confirmation_modal'; import type { BaseConfirmationModalProps } from './confirmation_modal'; import classes from './styles.module.css'; -export const PRIVATE_QUOTE_MODAL_ID = 'quote/private_notify'; - const messages = defineMessages({ title: { id: 'confirmations.private_quote_notify.title', diff --git a/app/javascript/mastodon/features/ui/components/skip_links/index.tsx b/app/javascript/mastodon/features/ui/components/skip_links/index.tsx index 7ecff95287..e5a74ba992 100644 --- a/app/javascript/mastodon/features/ui/components/skip_links/index.tsx +++ b/app/javascript/mastodon/features/ui/components/skip_links/index.tsx @@ -16,7 +16,7 @@ export const SkipLinks: React.FC<{ }> = ({ multiColumn, onFocusGettingStartedColumn }) => { const intl = useIntl(); const columnCount = useAppSelector((state) => { - const settings = state.settings as Immutable.Collection; + const settings = state.settings; return (settings.get('columns') as Immutable.Map).size; }); diff --git a/app/javascript/mastodon/reducers/settings.js b/app/javascript/mastodon/reducers/settings.js index c10d350600..136d57f4a5 100644 --- a/app/javascript/mastodon/reducers/settings.js +++ b/app/javascript/mastodon/reducers/settings.js @@ -165,6 +165,7 @@ const updateFrequentLanguages = (state, language) => state.update('frequentlyUse const filterDeadListColumns = (state, listId) => state.update('columns', columns => columns.filterNot(column => column.get('id') === 'LIST' && column.get('params').get('id') === listId)); +/** @type {import('@reduxjs/toolkit').Reducer>} */ export default function settings(state = initialState, action) { switch(action.type) { case STORE_HYDRATE: diff --git a/app/javascript/mastodon/selectors/settings.ts b/app/javascript/mastodon/selectors/settings.ts index 49e0df0c40..7958c0dd48 100644 --- a/app/javascript/mastodon/selectors/settings.ts +++ b/app/javascript/mastodon/selectors/settings.ts @@ -48,7 +48,12 @@ export const selectSettingsNotificationsShowUnread = (state: RootState) => state.settings.getIn(['notifications', 'showUnread']) as boolean; export const selectNeedsNotificationPermission = (state: RootState) => - (state.settings.getIn(['notifications', 'alerts']).includes(true) && + (( + state.settings.getIn(['notifications', 'alerts']) as Immutable.Map< + string, + boolean + > + ).includes(true) && state.notifications.get('browserSupport') && state.notifications.get('browserPermission') === 'default' && !state.settings.getIn([