Skip to content

Commit

Permalink
2024.5월 업데이트 분 (#3)
Browse files Browse the repository at this point in the history
* enhance(backend): 通知がミュート・凍結を考慮するようにする (misskey-dev#13412)

* Never return broken notifications misskey-dev#409

Since notifications are stored in Redis, we can't expect relational
integrity: deleting a user will *not* delete notifications that
mention it.

But if we return notifications with missing bits (a `follow` without a
`user`, for example), the frontend will get very confused and throw an
exception while trying to render them.

This change makes sure we never expose those broken notifications. For
uniformity, I've applied the same logic to notes and roles mentioned
in notifications, even if nobody reported breakage in those cases.

Tested by creating a few types of notifications with a `notifierId`,
then deleting their user.

(cherry picked from commit 421f8d4)

* Update Changelog

* Update CHANGELOG.md

* enhance: 通知がミュートを考慮するようにする

* enhance: 通知が凍結も考慮するようにする

* fix: notifierIdがない通知が消えてしまう問題

* Add tests (通知がミュートを考慮しているかどうか)

* fix: notifierIdがない通知が消えてしまう問題 (grouped)

* Remove unused import

* Fix: typo

* Revert "enhance: 通知が凍結も考慮するようにする"

This reverts commit b1e57e5.

* Revert API handling

* Remove unused imports

* enhance: Check if notifierId is valid in NotificationEntityService

* 通知作成時にpackしてnullになったらあとの処理をやめる

* Remove duplication of valid notifier check

* add filter notification is not null

* Revert "Remove duplication of valid notifier check"

This reverts commit 239a695.

* Improve performance

* Fix packGrouped

* Refactor: 判定部分を共通化

* Fix condition

* use isNotNull

* Update CHANGELOG.md

* filterの改善

* Refactor: DONT REPEAT YOURSELF
Note: GroupedNotificationはNotificationの拡張なのでその例外だけ書けば基本的に共通の処理になり複雑な個別の処理は増えにくいと思われる

* Add groupedNotificationTypes

* Update misskey-js typedef

* Refactor: less sql calls

* refactor

* clean up

* filter notes to mark as read

* packed noteがmapなのでそちらを使う

* if (notesToRead.size > 0)

* if (notes.length === 0) return;

* fix

* Revert "if (notes.length === 0) return;"

This reverts commit 22e2324.

* 🎨

* console.error

* err

* remove try-catch

* 不要なジェネリクスを除去

* Revert  (既読処理をpack内で行うものを元に戻す)

* Clean

* Update packages/backend/src/core/entities/NotificationEntityService.ts

* Update packages/backend/src/core/entities/NotificationEntityService.ts

* Update packages/backend/src/core/entities/NotificationEntityService.ts

* Update packages/backend/src/core/entities/NotificationEntityService.ts

* Update packages/backend/src/core/NotificationService.ts

* Clean

---------

Co-authored-by: dakkar <dakkar@thenautilus.net>
Co-authored-by: kakkokari-gtyih <daisho7308+f@gmail.com>
Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com>
Co-authored-by: tamaina <tamaina@hotmail.co.jp>
Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>

* Update CHANGELOG.md

* update deps

* fix type

* fix test

* Update scroll.test.ts

* enhance: 通知の履歴をリセットできるように (misskey-dev#13335)

* enhance: 通知の履歴をリセットできるように

* Update Changelog

* 通知欄も連動して更新するように

* revert some changes

* Update CHANGELOG.md

* Remove unused part

* fix

* fix(backend): ダイレクトなノートに対してはダイレクトでしか返信できないように (misskey-dev#13477)

* fix(backend): ダイレクトなノートに対してはダイレクトでしか返信できないように

* Update CHANGELOG.md

* test(backend): `notes/create`とWebSocket関連のテストを追加

* Update CHANGELOG.md

* New Crowdin updates (misskey-dev#13359)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Korean)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Italian)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (French)

* New translations ja-jp.yml (French)

* New translations ja-jp.yml (Italian)

* New translations ja-jp.yml (Italian)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Japanese, Kansai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Korean)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Catalan)

* New translations ja-jp.yml (German)

* New translations ja-jp.yml (Korean)

* New translations ja-jp.yml (Korean (Gyeongsang))

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (French)

* New translations ja-jp.yml (Spanish)

* New translations ja-jp.yml (Arabic)

* New translations ja-jp.yml (Czech)

* New translations ja-jp.yml (Italian)

* New translations ja-jp.yml (Norwegian)

* New translations ja-jp.yml (Portuguese)

* New translations ja-jp.yml (Russian)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (English)

* New translations ja-jp.yml (Vietnamese)

* New translations ja-jp.yml (Indonesian)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Japanese, Kansai)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (English)

* New translations ja-jp.yml (English)

* New translations ja-jp.yml (English)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Chinese Traditional)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Chinese Traditional)

* fix(client): use colorizeEmoji when unicodeEmojisMap.get

* Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop

* メンションの最大数をロールごとに設定可能にする (misskey-dev#13343)

* Add new role policy: maximum mentions per note

* fix

* Reviewを反映

* fix

* Add ChangeLog

* Update type definitions

* Add E2E test

* CHANGELOG に説明を追加

---------

Co-authored-by: taichan <40626578+tai-cha@users.noreply.github.com>

* Update CHANGELOG.md

* refactor: remove export of unicodeEmojisMap

* Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop

* fix packedRoleCondFormulaValueAssignedRoleSchema

* New Crowdin updates (misskey-dev#13478)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (English)

* New translations ja-jp.yml (Chinese Simplified)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* New translations ja-jp.yml (Thai)

* update pnpm

* update deps

* update deps

* update deps

* Update CHANGELOG.md

Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>

* Update CHANGELOG.md

* format

* Update packages/backend/test/e2e/mute.ts

Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>

* format

* Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop

* add missing license headers

* enhance: 禁止ワードチェック強化 (misskey-dev#27)

* enhance: 禁止ワードチェック強化
* リモートの禁止ワードチェックを添付ファイルとユーザーを登録する前に行うなど
  Resolve misskey-dev#13374
* 禁止ワートの対象の見直し

* performActivityで特定のエラーが出た際にDelayedに追加しないように

* use IdentifiableError

* NoteCreateService.checkProhibitedWords

* https://github.com/misskey-dev/misskey-private/pull/27/files#r1507416135

* remove comment

* 2024.3.0

* New translations ja-jp.yml (Chinese Traditional) (misskey-dev#13480)

* Merge pull request misskey-dev#13447 from misskey-dev/develop

Release: 2024.3.0

* fix: emoji colorization

* chore(client): 絵文字の画像読み込みに失敗した際はテキストではなくダミー画像を表示 (misskey-dev#13487)

* fix(frontend): ピン留め or 履歴に表示されるカスタム絵文字がサーバから削除されるとリアクションが出来なくなる (misskey-dev#13486)

* fix(frontend): ピン留めに登録されているカスタム絵文字がサーバから削除されるとリアクションが出来なくなる

* fix CHANGELOG.md

* fix Unicode Emojis

* fix Unicode Emojis

* fix

* New Crowdin updates (misskey-dev#13489)

* New translations ja-jp.yml (French)

* New translations ja-jp.yml (French)

* Update CHANGELOG.md

* Update CHANGELOG.md

* fix(frontend): MkCustomEmojiでフォールバックをテキストか画像か選べるように
fix of misskey-dev#13487

* 2024.3.1

* Merge pull request misskey-dev#13493 from misskey-dev/develop

Release: 2024.3.1

* Update README.md

* test(backend): refactor tests (misskey-dev#13499)

* test(backend): refactor tests

* fix: failed test

* chore: Automated release (misskey-dev#13075)

* chore: Automated release

* follow

* fix(backend): リモートサーバーの情報が更新できなくなっていた問題を修正 (misskey-dev#13507)

* fix(backend): fetchInstanceMetadataのLockが永遠に解除されない問題を修正

Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>

* fix test

* fix

* comment

* comment

* improve test

---------

Co-authored-by: まっちゃとーにゅ <17376330+u1-liquid@users.noreply.github.com>

* Update CHANGELOG.md

* remove template txt

*  doc: Nestで循環依存がある場合のCONTRIBUTING.mdに書く  (misskey-dev#13522)

* doc: Nestモジュールテストの例をCONTRIBUTING.mdに書く

* rm normal test

* forwardRef

* fix(frontend): router遷移時にmatchAllに入った場合一度`location.href`を経由するように (misskey-dev#13509)

* fix(frontend): router遷移時にmatchAllに入った場合一度`location.href`を経由するように

* Update Changelog

* Update CHANGELOG.md

* remove unnecessary args
  • Loading branch information
jbblily authored Jun 7, 2024
1 parent 2b992e6 commit a953dcf
Show file tree
Hide file tree
Showing 497 changed files with 28,951 additions and 16,559 deletions.
19 changes: 17 additions & 2 deletions .config/docker_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ redis:
# ┌───────────────────────────┐
#───┘ MeiliSearch configuration └─────────────────────────────

# You can set scope to local (default value) or global
# You can set scope to local (default value) or global
# (include notes from remote).

#meilisearch:
Expand Down Expand Up @@ -136,6 +136,21 @@ redis:

id: 'aidx'

# ┌────────────────┐
#───┘ Error tracking └──────────────────────────────────────────

# Sentry is available for error tracking.
# See the Sentry documentation for more details on options.

#sentryForBackend:
# enableNodeProfiling: true
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

#sentryForFrontend:
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

# ┌─────────────────────┐
#───┘ Other configuration └─────────────────────────────────────

Expand Down Expand Up @@ -185,7 +200,7 @@ proxyRemoteFiles: true
signToActivityPubGet: true

# For security reasons, uploading attachments from the intranet is prohibited,
# but exceptions can be made from the following settings. Default value is "undefined".
# but exceptions can be made from the following settings. Default value is "undefined".
# Read changelog to learn more (Improvements of 12.90.0 (2021/09/04)).
#allowedPrivateNetworks: [
# '127.0.0.1/32'
Expand Down
17 changes: 16 additions & 1 deletion .config/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# Option 3: If neither of the above applies to you.
# (In this case, the source code should be published
# on the Misskey interface. IT IS NOT ENOUGH TO
# DISCLOSE THE SOURCE CODE WEHN A USER REQUESTS IT BY
# DISCLOSE THE SOURCE CODE WHEN A USER REQUESTS IT BY
# E-MAIL OR OTHER MEANS. If you are not satisfied
# with this, it is recommended that you read the
# license again carefully. Anyway, enabling this
Expand Down Expand Up @@ -205,6 +205,21 @@ redis:

id: 'aidx'

# ┌────────────────┐
#───┘ Error tracking └──────────────────────────────────────────

# Sentry is available for error tracking.
# See the Sentry documentation for more details on options.

#sentryForBackend:
# enableNodeProfiling: true
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

#sentryForFrontend:
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

# ┌─────────────────────┐
#───┘ Other configuration └─────────────────────────────────────

Expand Down
9 changes: 3 additions & 6 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
"service": "app",
"workspaceFolder": "/workspace",
"features": {
"ghcr.io/devcontainers-contrib/features/pnpm:2": {
"version": "8.9.2"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "20.10.0"
}
"version": "20.12.2"
},
"ghcr.io/devcontainers-contrib/features/corepack:1": {}
},
"forwardPorts": [3000],
"postCreateCommand": "sudo chmod 755 .devcontainer/init.sh && .devcontainer/init.sh",
Expand All @@ -19,7 +17,6 @@
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"Orta.vscode-jest",
"dbaeumer.vscode-eslint",
"mrmlnc.vscode-json5"
Expand Down
15 changes: 15 additions & 0 deletions .devcontainer/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,21 @@ redis:

id: 'aidx'

# ┌────────────────┐
#───┘ Error tracking └──────────────────────────────────────────

# Sentry is available for error tracking.
# See the Sentry documentation for more details on options.

#sentryForBackend:
# enableNodeProfiling: true
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

#sentryForFrontend:
# options:
# dsn: 'https://examplePublicKey@o0.ingest.sentry.io/0'

# ┌─────────────────────┐
#───┘ Other configuration └─────────────────────────────────────

Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -xe

sudo chown -R node /workspace
git submodule update --init
corepack install
corepack enable
pnpm config set store-dir /home/node/.local/share/pnpm/store
pnpm install --frozen-lockfile
cp .devcontainer/devcontainer.yml .config/default.yml
Expand Down
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

147 changes: 73 additions & 74 deletions .github/workflows/check-misskey-js-autogen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,26 @@ on:
branches:
- master
- develop
- improve-misskey-js-autogen-check
paths:
- packages/backend/**

jobs:
check-misskey-js-autogen:
# pull_request_target safety: permissions: read-all, and there are no secrets used in this job
generate-misskey-js:
runs-on: ubuntu-latest
permissions:
pull-requests: write

env:
api_json_name: "api-head.json"

contents: read
if: ${{ github.event.pull_request.mergeable == null || github.event.pull_request.mergeable == true }}
steps:
- name: checkout
uses: actions/checkout@v4.1.1
with:
submodules: true
ref: ${{ github.event.pull_request.head.sha }}
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- name: setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
uses: pnpm/action-setup@v4

- name: setup node
id: setup-node
Expand All @@ -39,79 +36,81 @@ jobs:
- name: install dependencies
run: pnpm i --frozen-lockfile

- name: wait get-api-diff
uses: lewagon/wait-on-check-action@v1.3.3
# generate api.json
- name: Copy Config
run: cp .config/example.yml .config/default.yml
- name: Build
run: pnpm build
- name: Generate API JSON
run: pnpm --filter backend generate-api-json

# build misskey js
- name: Build misskey-js
run: |-
cp packages/backend/built/api.json packages/misskey-js/generator/api.json
pnpm run --filter misskey-js-type-generator generate
# packages/misskey-js/generator/built/autogen
- name: Upload Generated
uses: actions/upload-artifact@v4
with:
name: generated-misskey-js
path: packages/misskey-js/generator/built/autogen

# pull_request_target safety: permissions: read-all, and there are no secrets used in this job
get-actual-misskey-js:
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ github.event.pull_request.mergeable == null || github.event.pull_request.mergeable == true }}
steps:
- name: checkout
uses: actions/checkout@v4.1.1
with:
ref: ${{ github.event.pull_request.head.sha }}
check-regexp: get-from-misskey .+
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
submodules: true
ref: refs/pull/${{ github.event.pull_request.number }}/merge

- name: Download artifact
uses: actions/github-script@v7.0.1
- name: Upload From Merged
uses: actions/upload-artifact@v4
with:
script: |
const fs = require('fs');
const workflows = await github.rest.actions.listWorkflowRunsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
head_sha: `${{ github.event.pull_request.head.sha }}`
}).then(x => x.data.workflow_runs);
console.log(workflows.map(x => ({name: x.name, title: x.display_title})));
const run_id = workflows.find(x => x.name.includes("Get api.json from Misskey")).id;
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: run_id,
});
let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name.startsWith("api-artifact-") || artifact.name == "api-artifact"
});
await Promise.all(matchArtifacts.map(async (artifact) => {
let download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id,
archive_format: 'zip',
});
await fs.promises.writeFile(`${process.env.GITHUB_WORKSPACE}/${artifact.name}.zip`, Buffer.from(download.data));
}));
- name: unzip artifacts
run: |-
find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d . ';'
ls -la
name: actual-misskey-js
path: packages/misskey-js/src/autogen

- name: get head checksum
run: |-
checksum=$(realpath head_checksum)
# pull_request_target safety: nothing is cloned from repository
comment-misskey-js-autogen:
runs-on: ubuntu-latest
needs: [generate-misskey-js, get-actual-misskey-js]
permissions:
pull-requests: write
steps:
- name: download generated-misskey-js
uses: actions/download-artifact@v4
with:
name: generated-misskey-js
path: misskey-js-generated

cd packages/misskey-js/src
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
cd ../../..
- name: download actual-misskey-js
uses: actions/download-artifact@v4
with:
name: actual-misskey-js
path: misskey-js-actual

- name: build autogen
run: |-
checksum=$(realpath ${api_json_name}_checksum)
mv $api_json_name packages/misskey-js/generator/api.json
- name: check misskey-js changes
id: check-changes
run: |
diff -r -u --label=generated --label=on-tree ./misskey-js-generated ./misskey-js-actual > misskey-js.diff || true
cd packages/misskey-js/generator
pnpm run generate
cd built
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
cd ../../../..
if [ -s misskey-js.diff ]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
- name: check update for type definitions
run: diff head_checksum ${api_json_name}_checksum
- name: Print full diff
run: cat ./misskey-js.diff

- name: send message
if: failure()
if: steps.check-changes.outputs.changes == 'true'
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: check-misskey-js-autogen
Expand All @@ -125,7 +124,7 @@ jobs:
```
- name: send message
if: success()
if: steps.check-changes.outputs.changes == 'false'
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: check-misskey-js-autogen
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/check-spdx-license-id.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Check SPDX-License-Identifier

on:
push:
branches:
- master
- develop
pull_request:

jobs:
check-spdx-license-id:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.1
- name: Check
run: |
counter=0
search() {
local directory="$1"
find "$directory" -type f \
'(' \
-name "*.cjs" -and -not -name '*.config.cjs' -o \
-name "*.html" -o \
-name "*.js" -and -not -name '*.config.js' -o \
-name "*.mjs" -and -not -name '*.config.mjs' -o \
-name "*.scss" -o \
-name "*.ts" -and -not -name '*.config.ts' -o \
-name "*.vue" \
')' -and \
-not -name '*eslint*'
}
check() {
local file="$1"
if ! (
grep -q "SPDX-FileCopyrightText: syuilo and misskey-project" "$file" ||
grep -q "SPDX-License-Identifier: AGPL-3.0-only" "$file"
); then
echo "Missing: $file"
((counter++))
fi
}
directories=(
"cypress/e2e"
"packages/backend/migration"
"packages/backend/src"
"packages/backend/test"
"packages/frontend/.storybook"
"packages/frontend/@types"
"packages/frontend/lib"
"packages/frontend/public"
"packages/frontend/src"
"packages/frontend/test"
"packages/misskey-bubble-game/src"
"packages/misskey-reversi/src"
"packages/sw/src"
"scripts"
)
for directory in "${directories[@]}"; do
for file in $(search $directory); do
check "$file"
done
done
if [ $counter -gt 0 ]; then
echo "SPDX-License-Identifier is missing in $counter files."
exit 1
else
echo "SPDX-License-Identifier is certainly described in all target files!"
exit 0
fi
Loading

0 comments on commit a953dcf

Please sign in to comment.