Compare commits

...

15 Commits

Author SHA1 Message Date
Claire
21b324cc88 Merge pull request #3183 from ClearlyClaire/glitch-soc/merge-4.3
Merge upstream changes up to 51b29f4c30 to stable-4.3
2025-09-16 18:17:29 +02:00
Claire
5f07606955 Merge commit '51b29f4c30ef40d6f4ca6f8589b6093a5665c3a3' into glitch-soc/merge-4.3 2025-09-16 18:01:13 +02:00
Claire
51b29f4c30 Bump version to v4.3.12 2025-09-16 13:54:37 +02:00
Claire
0ec46833fa Update rails dependencies 2025-09-16 13:54:37 +02:00
Claire
de488fbea2 Merge pull request #3175 from ClearlyClaire/glitch-soc/merge-4.3
Merge upstream changes up to 6b78be274b into stable-4.3
2025-09-05 19:24:46 +02:00
Claire
d595641b73 [Glitch] Fix editing or deleting and redrafting polls in 4.3
Port 055be70c59 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2025-09-05 12:18:27 +02:00
Claire
fd733d0603 Merge remote-tracking branch 'upstream/stable-4.3' into glitch-soc/merge-4.3 2025-09-05 12:18:08 +02:00
Claire
055be70c59 Fix editing or deleting and redrafting polls in 4.3 (#36036) 2025-09-05 12:17:02 +02:00
Claire
0eeb0f00ba [Glitch] Fix API return types for interaction API helpers
Port 8777443c9b to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2025-09-04 19:18:23 +02:00
Claire
6e406e119f [Glitch] Fix Edit as well as “Delete & Redraft” on a poll not inserting empty option
Port a48567784c to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2025-09-04 19:18:17 +02:00
Claire
789df6b196 Merge remote-tracking branch 'upstream/stable-4.3' into glitch-soc/merge-4.3 2025-09-04 19:14:04 +02:00
fiona
6b78be274b Fix handling of edited status with new media and no text (#35970) 2025-09-04 15:44:53 +02:00
Claire
a3d4b7c9b9 Fix API return types for interaction API helpers (#35915) 2025-09-04 15:44:53 +02:00
Claire
d2b544e584 Fix Edit as well as “Delete & Redraft” on a poll not inserting empty option (#35892) 2025-09-04 15:44:53 +02:00
Claire
84c5ffb565 Fix self-destruct scheduler behavior on some Redis setups (#35823) 2025-09-04 15:44:53 +02:00
15 changed files with 181 additions and 88 deletions

View File

@@ -2,6 +2,18 @@
All notable changes to this project will be documented in this file.
## [4.3.12] - 2025-09-16
### Security
- Update dependencies
### Fixed
- Fix processing of remote edited statuses with new media and no text (#35970 by @unfokus)
- Fix “Edit” and “Delete & Redraft” on a poll not inserting empty option (#35892 by @ClearlyClaire)
- Fix self-destruct scheduler behavior on some Redis setups (#35823 by @ClearlyClaire)
## [4.3.11] - 2025-08-05
### Security

View File

@@ -10,35 +10,35 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.5.1)
actionpack (= 7.1.5.1)
activesupport (= 7.1.5.1)
actioncable (7.1.5.2)
actionpack (= 7.1.5.2)
activesupport (= 7.1.5.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.5.1)
actionpack (= 7.1.5.1)
activejob (= 7.1.5.1)
activerecord (= 7.1.5.1)
activestorage (= 7.1.5.1)
activesupport (= 7.1.5.1)
actionmailbox (7.1.5.2)
actionpack (= 7.1.5.2)
activejob (= 7.1.5.2)
activerecord (= 7.1.5.2)
activestorage (= 7.1.5.2)
activesupport (= 7.1.5.2)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.5.1)
actionpack (= 7.1.5.1)
actionview (= 7.1.5.1)
activejob (= 7.1.5.1)
activesupport (= 7.1.5.1)
actionmailer (7.1.5.2)
actionpack (= 7.1.5.2)
actionview (= 7.1.5.2)
activejob (= 7.1.5.2)
activesupport (= 7.1.5.2)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2)
actionpack (7.1.5.1)
actionview (= 7.1.5.1)
activesupport (= 7.1.5.1)
actionpack (7.1.5.2)
actionview (= 7.1.5.2)
activesupport (= 7.1.5.2)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
@@ -46,15 +46,15 @@ GEM
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.5.1)
actionpack (= 7.1.5.1)
activerecord (= 7.1.5.1)
activestorage (= 7.1.5.1)
activesupport (= 7.1.5.1)
actiontext (7.1.5.2)
actionpack (= 7.1.5.2)
activerecord (= 7.1.5.2)
activestorage (= 7.1.5.2)
activesupport (= 7.1.5.2)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.5.1)
activesupport (= 7.1.5.1)
actionview (7.1.5.2)
activesupport (= 7.1.5.2)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
@@ -64,22 +64,22 @@ GEM
activemodel (>= 4.1)
case_transform (>= 0.2)
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
activejob (7.1.5.1)
activesupport (= 7.1.5.1)
activejob (7.1.5.2)
activesupport (= 7.1.5.2)
globalid (>= 0.3.6)
activemodel (7.1.5.1)
activesupport (= 7.1.5.1)
activerecord (7.1.5.1)
activemodel (= 7.1.5.1)
activesupport (= 7.1.5.1)
activemodel (7.1.5.2)
activesupport (= 7.1.5.2)
activerecord (7.1.5.2)
activemodel (= 7.1.5.2)
activesupport (= 7.1.5.2)
timeout (>= 0.4.0)
activestorage (7.1.5.1)
actionpack (= 7.1.5.1)
activejob (= 7.1.5.1)
activerecord (= 7.1.5.1)
activesupport (= 7.1.5.1)
activestorage (7.1.5.2)
actionpack (= 7.1.5.2)
activejob (= 7.1.5.2)
activerecord (= 7.1.5.2)
activesupport (= 7.1.5.2)
marcel (~> 1.0)
activesupport (7.1.5.1)
activesupport (7.1.5.2)
base64
benchmark (>= 0.3)
bigdecimal
@@ -642,20 +642,20 @@ GEM
rackup (1.0.0)
rack (< 3)
webrick
rails (7.1.5.1)
actioncable (= 7.1.5.1)
actionmailbox (= 7.1.5.1)
actionmailer (= 7.1.5.1)
actionpack (= 7.1.5.1)
actiontext (= 7.1.5.1)
actionview (= 7.1.5.1)
activejob (= 7.1.5.1)
activemodel (= 7.1.5.1)
activerecord (= 7.1.5.1)
activestorage (= 7.1.5.1)
activesupport (= 7.1.5.1)
rails (7.1.5.2)
actioncable (= 7.1.5.2)
actionmailbox (= 7.1.5.2)
actionmailer (= 7.1.5.2)
actionpack (= 7.1.5.2)
actiontext (= 7.1.5.2)
actionview (= 7.1.5.2)
activejob (= 7.1.5.2)
activemodel (= 7.1.5.2)
activerecord (= 7.1.5.2)
activestorage (= 7.1.5.2)
activesupport (= 7.1.5.2)
bundler (>= 1.15.0)
railties (= 7.1.5.1)
railties (= 7.1.5.2)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
@@ -670,9 +670,9 @@ GEM
rails-i18n (7.0.9)
i18n (>= 0.7, < 2)
railties (>= 6.0.0, < 8)
railties (7.1.5.1)
actionpack (= 7.1.5.1)
activesupport (= 7.1.5.1)
railties (7.1.5.2)
actionpack (= 7.1.5.2)
activesupport (= 7.1.5.2)
irb
rackup (>= 1.0.0)
rake (>= 12.2)

View File

@@ -102,12 +102,17 @@ export const ensureComposeIsVisible = (getState) => {
};
export function setComposeToStatus(status, text, spoiler_text, content_type) {
return{
type: COMPOSE_SET_STATUS,
status,
text,
spoiler_text,
content_type,
return (dispatch, getState) => {
const maxOptions = getState().server.getIn(['server', 'configuration', 'polls', 'max_options']);
dispatch({
type: COMPOSE_SET_STATUS,
status,
text,
spoiler_text,
content_type,
maxOptions
});
};
}

View File

@@ -90,11 +90,16 @@ export function fetchStatusFail(id, error, skipLoading) {
}
export function redraft(status, raw_text, content_type) {
return {
type: REDRAFT,
status,
raw_text,
content_type,
return (dispatch, getState) => {
const maxOptions = getState().server.getIn(['server', 'configuration', 'polls', 'max_options']);
dispatch({
type: REDRAFT,
status,
raw_text,
content_type,
maxOptions,
});
};
}

View File

@@ -1,10 +1,11 @@
import { apiRequestPost } from 'flavours/glitch/api';
import type { Status, StatusVisibility } from 'flavours/glitch/models/status';
import type { ApiStatusJSON } from 'flavours/glitch/api_types/statuses';
import type { StatusVisibility } from 'flavours/glitch/models/status';
export const apiReblog = (statusId: string, visibility: StatusVisibility) =>
apiRequestPost<{ reblog: Status }>(`v1/statuses/${statusId}/reblog`, {
apiRequestPost<{ reblog: ApiStatusJSON }>(`v1/statuses/${statusId}/reblog`, {
visibility,
});
export const apiUnreblog = (statusId: string) =>
apiRequestPost<Status>(`v1/statuses/${statusId}/unreblog`);
apiRequestPost<ApiStatusJSON>(`v1/statuses/${statusId}/unreblog`);

View File

@@ -623,8 +623,13 @@ export default function compose(state = initialState, action) {
}
if (action.status.get('poll')) {
let options = action.status.getIn(['poll', 'options']).map(x => x.get('title'));
if (options.size < action.maxOptions) {
options = options.push('');
}
map.set('poll', ImmutableMap({
options: action.status.getIn(['poll', 'options']).map(x => x.get('title')),
options: options,
multiple: action.status.getIn(['poll', 'multiple']),
expires_in: expiresInFromExpiresAt(action.status.getIn(['poll', 'expires_at'])),
}));
@@ -653,8 +658,13 @@ export default function compose(state = initialState, action) {
}
if (action.status.get('poll')) {
let options = action.status.getIn(['poll', 'options']).map(x => x.get('title'));
if (options.size < action.maxOptions) {
options = options.push('');
}
map.set('poll', ImmutableMap({
options: action.status.getIn(['poll', 'options']).map(x => x.get('title')),
options: options,
multiple: action.status.getIn(['poll', 'multiple']),
expires_in: expiresInFromExpiresAt(action.status.getIn(['poll', 'expires_at'])),
}));

View File

@@ -96,11 +96,16 @@ export const ensureComposeIsVisible = (getState) => {
};
export function setComposeToStatus(status, text, spoiler_text) {
return{
type: COMPOSE_SET_STATUS,
status,
text,
spoiler_text,
return (dispatch, getState) => {
const maxOptions = getState().server.getIn(['server', 'configuration', 'polls', 'max_options']);
dispatch({
type: COMPOSE_SET_STATUS,
status,
text,
spoiler_text,
maxOptions,
});
};
}

View File

@@ -90,10 +90,15 @@ export function fetchStatusFail(id, error, skipLoading) {
}
export function redraft(status, raw_text) {
return {
type: REDRAFT,
status,
raw_text,
return (dispatch, getState) => {
const maxOptions = getState().server.getIn(['server', 'configuration', 'polls', 'max_options']);
dispatch({
type: REDRAFT,
status,
raw_text,
maxOptions,
});
};
}

View File

@@ -1,10 +1,11 @@
import { apiRequestPost } from 'mastodon/api';
import type { Status, StatusVisibility } from 'mastodon/models/status';
import type { ApiStatusJSON } from 'mastodon/api_types/statuses';
import type { StatusVisibility } from 'mastodon/models/status';
export const apiReblog = (statusId: string, visibility: StatusVisibility) =>
apiRequestPost<{ reblog: Status }>(`v1/statuses/${statusId}/reblog`, {
apiRequestPost<{ reblog: ApiStatusJSON }>(`v1/statuses/${statusId}/reblog`, {
visibility,
});
export const apiUnreblog = (statusId: string) =>
apiRequestPost<Status>(`v1/statuses/${statusId}/unreblog`);
apiRequestPost<ApiStatusJSON>(`v1/statuses/${statusId}/unreblog`);

View File

@@ -504,8 +504,13 @@ export default function compose(state = initialState, action) {
}
if (action.status.get('poll')) {
let options = action.status.getIn(['poll', 'options']).map(x => x.get('title'));
if (options.size < action.maxOptions) {
options = options.push('');
}
map.set('poll', ImmutableMap({
options: action.status.getIn(['poll', 'options']).map(x => x.get('title')),
options: options,
multiple: action.status.getIn(['poll', 'multiple']),
expires_in: expiresInFromExpiresAt(action.status.getIn(['poll', 'expires_at'])),
}));
@@ -533,8 +538,13 @@ export default function compose(state = initialState, action) {
}
if (action.status.get('poll')) {
let options = action.status.getIn(['poll', 'options']).map(x => x.get('title'));
if (options.size < action.maxOptions) {
options = options.push('');
}
map.set('poll', ImmutableMap({
options: action.status.getIn(['poll', 'options']).map(x => x.get('title')),
options: options,
multiple: action.status.getIn(['poll', 'multiple']),
expires_in: expiresInFromExpiresAt(action.status.getIn(['poll', 'expires_at'])),
}));

View File

@@ -100,6 +100,8 @@ class ActivityPub::ProcessStatusUpdateService < BaseService
@status.ordered_media_attachment_ids = @next_media_attachments.map(&:id)
@media_attachments_changed = true if @status.ordered_media_attachment_ids != previous_media_attachments_ids
@status.media_attachments.reload if @media_attachments_changed
end
def download_media_files!

View File

@@ -21,8 +21,9 @@ class Scheduler::SelfDestructScheduler
def sidekiq_overwhelmed?
redis_mem_info = Sidekiq.redis_info
maxmemory = [redis_mem_info['maxmemory'].to_f, redis_mem_info['total_system_memory'].to_f].filter(&:positive?).min
Sidekiq::Stats.new.enqueued > MAX_ENQUEUED || redis_mem_info['used_memory'].to_f > redis_mem_info['total_system_memory'].to_f * MAX_REDIS_MEM_USAGE
Sidekiq::Stats.new.enqueued > MAX_ENQUEUED || redis_mem_info['used_memory'].to_f > maxmemory * MAX_REDIS_MEM_USAGE
end
def delete_accounts!

View File

@@ -59,7 +59,7 @@ services:
web:
# You can uncomment the following line if you want to not use the prebuilt image, for example if you have local code changes
# build: .
image: ghcr.io/glitch-soc/mastodon:v4.3.11
image: ghcr.io/glitch-soc/mastodon:v4.3.12
restart: always
env_file: .env.production
command: bundle exec puma -C config/puma.rb
@@ -83,7 +83,7 @@ services:
# build:
# dockerfile: ./streaming/Dockerfile
# context: .
image: ghcr.io/glitch-soc/mastodon-streaming:v4.3.11
image: ghcr.io/glitch-soc/mastodon-streaming:v4.3.12
restart: always
env_file: .env.production
command: node ./streaming/index.js
@@ -102,7 +102,7 @@ services:
sidekiq:
# You can uncomment the following line if you want to not use the prebuilt image, for example if you have local code changes
# build: .
image: ghcr.io/glitch-soc/mastodon:v4.3.11
image: ghcr.io/glitch-soc/mastodon:v4.3.12
restart: always
env_file: .env.production
command: bundle exec sidekiq

View File

@@ -13,7 +13,7 @@ module Mastodon
end
def patch
11
12
end
def default_prerelease

View File

@@ -343,6 +343,42 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
end
end
context 'when originally without media attachments and text is removed' do
before do
stub_request(:get, 'https://example.com/foo.png').to_return(body: attachment_fixture('emojo.png'))
end
let(:payload) do
{
'@context': 'https://www.w3.org/ns/activitystreams',
id: 'foo',
type: 'Note',
content: '',
updated: '2021-09-08T22:39:25Z',
attachment: [
{ type: 'Image', mediaType: 'image/png', url: 'https://example.com/foo.png' },
],
}
end
it 'updates media attachments, fetches attachment, records media and text removal in edit' do
subject.call(status, json, json)
expect(status.reload.ordered_media_attachments.first)
.to be_present
.and(have_attributes(remote_url: 'https://example.com/foo.png'))
expect(a_request(:get, 'https://example.com/foo.png'))
.to have_been_made
expect(status.edits.reload.last.ordered_media_attachment_ids)
.to_not be_empty
expect(status.edits.reload.last.text)
.to_not be_present
end
end
context 'when originally with media attachments' do
let(:media_attachments) { [Fabricate(:media_attachment, remote_url: 'https://example.com/foo.png'), Fabricate(:media_attachment, remote_url: 'https://example.com/unused.png')] }