forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2426 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes up to 57f592f
- Loading branch information
Showing
99 changed files
with
819 additions
and
396 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
ignore: | ||
# Sidekiq security issue, fixes in the latest Sidekiq 7 but we can not upgrade. Will be fixed in Sidekiq 6.5.10 | ||
- CVE-2023-26141 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
module DatabaseHelper | ||
def replica_enabled? | ||
ENV['REPLICA_DB_NAME'] || ENV.fetch('REPLICA_DATABASE_URL', nil) | ||
end | ||
module_function :replica_enabled? | ||
|
||
def with_read_replica(&block) | ||
ApplicationRecord.connected_to(role: :reading, prevent_writes: true, &block) | ||
if replica_enabled? | ||
ApplicationRecord.connected_to(role: :reading, prevent_writes: true, &block) | ||
else | ||
yield | ||
end | ||
end | ||
|
||
def with_primary(&block) | ||
ApplicationRecord.connected_to(role: :writing, &block) | ||
if replica_enabled? | ||
ApplicationRecord.connected_to(role: :writing, &block) | ||
else | ||
yield | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createAction } from '@reduxjs/toolkit'; | ||
|
||
export const openDropdownMenu = createAction<{ | ||
id: string; | ||
keyboard: boolean; | ||
scrollKey: string; | ||
}>('dropdownMenu/open'); | ||
|
||
export const closeDropdownMenu = createAction<{ id: string }>( | ||
'dropdownMenu/close', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { createReducer } from '@reduxjs/toolkit'; | ||
|
||
import { closeDropdownMenu, openDropdownMenu } from '../actions/dropdown_menu'; | ||
|
||
interface DropdownMenuState { | ||
openId: string | null; | ||
keyboard: boolean; | ||
scrollKey: string | null; | ||
} | ||
|
||
const initialState: DropdownMenuState = { | ||
openId: null, | ||
keyboard: false, | ||
scrollKey: null, | ||
}; | ||
|
||
export const dropdownMenuReducer = createReducer(initialState, (builder) => { | ||
builder | ||
.addCase( | ||
openDropdownMenu, | ||
(state, { payload: { id, keyboard, scrollKey } }) => { | ||
state.openId = id; | ||
state.keyboard = keyboard; | ||
state.scrollKey = scrollKey; | ||
}, | ||
) | ||
.addCase(closeDropdownMenu, (state, { payload: { id } }) => { | ||
if (state.openId === id) { | ||
state.openId = null; | ||
state.scrollKey = null; | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.