diff --git a/CHANGELOG.md b/CHANGELOG.md index a0fd237a3..f6e56e17e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ You should also include the user name that made the change. --> +## 13.x.x (unreleased) + +### Improvements + +### Bugfixes +- Windows環境でswcを使うと正しくビルドできない問題の修正 + ## 13.7.5 (2023/02/24) ### Note diff --git a/packages/backend/package.json b/packages/backend/package.json index c5cddac9d..4d1d37eff 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -54,7 +54,7 @@ "@peertube/http-signature": "1.7.0", "@sinonjs/fake-timers": "10.0.2", "@swc/cli": "0.1.62", - "@swc/core": "1.3.35", + "@swc/core": "1.3.36", "accepts": "1.3.8", "ajv": "8.12.0", "archiver": "5.3.1", diff --git a/packages/backend/src/core/activitypub/ApInboxService.ts b/packages/backend/src/core/activitypub/ApInboxService.ts index 21d2d16ed..6d9569bce 100644 --- a/packages/backend/src/core/activitypub/ApInboxService.ts +++ b/packages/backend/src/core/activitypub/ApInboxService.ts @@ -450,8 +450,10 @@ export class ApInboxService { return `skip: delete actor ${actor.uri} !== ${uri}`; } - const user = await this.usersRepository.findOneByOrFail({ id: actor.id }); - if (user.isDeleted) { + const user = await this.usersRepository.findOneBy({ id: actor.id }); + if (user == null) { + return 'skip: actor not found'; + } else if (user.isDeleted) { return 'skip: already deleted'; } diff --git a/packages/backend/src/server/web/manifest.json b/packages/backend/src/server/web/manifest.json index f8b77cbd9..41171d62a 100644 --- a/packages/backend/src/server/web/manifest.json +++ b/packages/backend/src/server/web/manifest.json @@ -17,10 +17,18 @@ "sizes": "512x512", "type": "image/png", "purpose": "maskable" + }, + { + "src": "/static-assets/splash.png", + "sizes": "300x300", + "type": "image/png", + "purpose": "any" } ], "share_target": { "action": "/share/", + "method": "GET", + "enctype": "application/x-www-form-urlencoded", "params": { "title": "title", "text": "text", diff --git a/packages/frontend/src/components/MkPagination.vue b/packages/frontend/src/components/MkPagination.vue index 84ba94361..378d0ac02 100644 --- a/packages/frontend/src/components/MkPagination.vue +++ b/packages/frontend/src/components/MkPagination.vue @@ -42,6 +42,7 @@ import { computed, ComputedRef, isRef, nextTick, onActivated, onBeforeUnmount, o import * as misskey from 'misskey-js'; import * as os from '@/os'; import { onScrollTop, isTopVisible, getBodyScrollHeight, getScrollContainer, onScrollBottom, scrollToBottom, scroll, isBottomVisible } from '@/scripts/scroll'; +import { useDocumentVisibility } from '@/scripts/use-document-visibility'; import MkButton from '@/components/MkButton.vue'; import { defaultStore } from '@/store'; import { MisskeyEntity } from '@/types/date-separated-list'; @@ -107,6 +108,12 @@ const { const contentEl = $computed(() => props.pagination.pageEl ?? rootEl); const scrollableElement = $computed(() => getScrollContainer(contentEl)); +const visibility = useDocumentVisibility(); + +let isPausingUpdate = false; +let timerForSetPause: number | null = null; +const BACKGROUND_PAUSE_WAIT_SEC = 10; + // 先頭が表示されているかどうかを検出 // https://qiita.com/mkataigi/items/0154aefd2223ce23398e let scrollObserver = $ref(); @@ -279,6 +286,28 @@ const fetchMoreAhead = async (): Promise => { }); }; +const isTop = (): boolean => isBackTop.value || (props.pagination.reversed ? isBottomVisible : isTopVisible)(contentEl, TOLERANCE); + +watch(visibility, () => { + if (visibility.value === 'hidden') { + timerForSetPause = window.setTimeout(() => { + isPausingUpdate = true; + timerForSetPause = null; + }, + BACKGROUND_PAUSE_WAIT_SEC * 1000); + } else { // 'visible' + if (timerForSetPause) { + clearTimeout(timerForSetPause); + timerForSetPause = null; + } else { + isPausingUpdate = false; + if (isTop()) { + executeQueue(); + } + } + } +}); + const prepend = (item: MisskeyEntity): void => { // 初回表示時はunshiftだけでOK if (!rootEl) { @@ -286,9 +315,7 @@ const prepend = (item: MisskeyEntity): void => { return; } - const isTop = isBackTop.value || (props.pagination.reversed ? isBottomVisible : isTopVisible)(contentEl, TOLERANCE); - - if (isTop) unshiftItems([item]); + if (isTop() && !isPausingUpdate) unshiftItems([item]); else prependQueue(item); }; @@ -357,6 +384,10 @@ onMounted(() => { }); onBeforeUnmount(() => { + if (timerForSetPause) { + clearTimeout(timerForSetPause); + timerForSetPause = null; + } scrollObserver.disconnect(); }); diff --git a/packages/frontend/src/scripts/use-document-visibility.ts b/packages/frontend/src/scripts/use-document-visibility.ts new file mode 100644 index 000000000..47e91dd93 --- /dev/null +++ b/packages/frontend/src/scripts/use-document-visibility.ts @@ -0,0 +1,19 @@ +import { onMounted, onUnmounted, ref, Ref } from 'vue'; + +export function useDocumentVisibility(): Ref { + const visibility = ref(document.visibilityState); + + const onChange = (): void => { + visibility.value = document.visibilityState; + }; + + onMounted(() => { + document.addEventListener('visibilitychange', onChange); + }); + + onUnmounted(() => { + document.removeEventListener('visibilitychange', onChange); + }); + + return visibility; +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58369e320..6273952ea 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,7 +67,7 @@ importers: '@redocly/openapi-core': 1.0.0-beta.123 '@sinonjs/fake-timers': 10.0.2 '@swc/cli': 0.1.62 - '@swc/core': 1.3.35 + '@swc/core': 1.3.36 '@swc/core-android-arm64': ^1.3.11 '@swc/core-darwin-arm64': ^1.3.36 '@swc/core-darwin-x64': ^1.3.36 @@ -235,8 +235,8 @@ importers: '@nestjs/testing': 9.3.9_77foi4w27ghy47yutmnzv7krjy '@peertube/http-signature': 1.7.0 '@sinonjs/fake-timers': 10.0.2 - '@swc/cli': 0.1.62_r2avoeggowhtjk5lmq5oy455q4 - '@swc/core': 1.3.35 + '@swc/cli': 0.1.62_wyduggqpvtv2oy5nc7cgtozgpy + '@swc/core': 1.3.36 accepts: 1.3.8 ajv: 8.12.0 archiver: 5.3.1 @@ -342,7 +342,7 @@ importers: devDependencies: '@jest/globals': 29.4.3 '@redocly/openapi-core': 1.0.0-beta.123 - '@swc/jest': 0.2.24_@swc+core@1.3.35 + '@swc/jest': 0.2.24_@swc+core@1.3.36 '@types/accepts': 1.3.5 '@types/archiver': 5.3.1 '@types/bcryptjs': 2.4.2 @@ -2167,7 +2167,7 @@ packages: resolution: {integrity: sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==} dev: false - /@swc/cli/0.1.62_r2avoeggowhtjk5lmq5oy455q4: + /@swc/cli/0.1.62_wyduggqpvtv2oy5nc7cgtozgpy: resolution: {integrity: sha512-kOFLjKY3XH1DWLfXL1/B5MizeNorHR8wHKEi92S/Zi9Md/AK17KSqR8MgyRJ6C1fhKHvbBCl8wboyKAFXStkYw==} engines: {node: '>= 12.13'} hasBin: true @@ -2179,7 +2179,7 @@ packages: optional: true dependencies: '@mole-inc/bin-wrapper': 8.0.1 - '@swc/core': 1.3.35 + '@swc/core': 1.3.36 chokidar: 3.5.3 commander: 7.2.0 fast-glob: 3.2.12 @@ -2199,29 +2199,12 @@ packages: dev: false optional: true - /@swc/core-darwin-arm64/1.3.35: - resolution: {integrity: sha512-zQUFkHx4gZpu0uo2IspvPnKsz8bsdXd5bC33xwjtoAI1cpLerDyqo4v2zIahEp+FdKZjyVsLHtfJiQiA1Qka3A==} - engines: {node: '>=10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - optional: true - /@swc/core-darwin-arm64/1.3.36: resolution: {integrity: sha512-lsP+C8p9cC/Vd9uAbtxpEnM8GoJI/MMnVuXak7OlxOtDH9/oTwmAcAQTfNGNaH19d2FAIRwf+5RbXCPnxa2Zjw==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] requiresBuild: true - dev: false - optional: true - - /@swc/core-darwin-x64/1.3.35: - resolution: {integrity: sha512-oOSkSGWtALovaw22lNevKD434OQTPf8X+dVPvPMrJXJpJ34dWDlFWpLntoc+arvKLNZ7LQmTuk8rR1hkrAY7cw==} - engines: {node: '>=10'} - cpu: [x64] - os: [darwin] - requiresBuild: true optional: true /@swc/core-darwin-x64/1.3.36: @@ -2230,15 +2213,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: false - optional: true - - /@swc/core-linux-arm-gnueabihf/1.3.35: - resolution: {integrity: sha512-Yie8k00O6O8BCATS/xeKStquV4OYSskUGRDXBQVDw1FrE23PHaSeHCgg4q6iNZjJzXCOJbaTCKnYoIDn9DMf7A==} - engines: {node: '>=10'} - cpu: [arm] - os: [linux] - requiresBuild: true optional: true /@swc/core-linux-arm-gnueabihf/1.3.36: @@ -2247,15 +2221,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: false - optional: true - - /@swc/core-linux-arm64-gnu/1.3.35: - resolution: {integrity: sha512-Zlv3WHa/4x2p51HSvjUWXHfSe1Gl2prqImUZJc8NZOlj75BFzVuR0auhQ+LbwvIQ3gaA1LODX9lyS9wXL3yjxA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - requiresBuild: true optional: true /@swc/core-linux-arm64-gnu/1.3.36: @@ -2264,15 +2229,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false - optional: true - - /@swc/core-linux-arm64-musl/1.3.35: - resolution: {integrity: sha512-u6tCYsrSyZ8U+4jLMA/O82veBfLy2aUpn51WxQaeH7wqZGy9TGSJXoO8vWxARQ6b72vjsnKDJHP4MD8hFwcctg==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - requiresBuild: true optional: true /@swc/core-linux-arm64-musl/1.3.36: @@ -2281,15 +2237,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false - optional: true - - /@swc/core-linux-x64-gnu/1.3.35: - resolution: {integrity: sha512-Dtxf2IbeH7XlNhP1Qt2/MvUPkpEbn7hhGfpSRs4ot8D3Vf5QEX4S/QtC1OsFWuciiYgHAT1Ybjt4xZic9DSkmA==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - requiresBuild: true optional: true /@swc/core-linux-x64-gnu/1.3.36: @@ -2298,15 +2245,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false - optional: true - - /@swc/core-linux-x64-musl/1.3.35: - resolution: {integrity: sha512-4XavNJ60GprjpTiESCu5daJUnmErixPAqDitJSMu4TV32LNIE8G00S9pDLXinDTW1rgcGtQdq1NLkNRmwwovtg==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - requiresBuild: true optional: true /@swc/core-linux-x64-musl/1.3.36: @@ -2315,15 +2253,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false - optional: true - - /@swc/core-win32-arm64-msvc/1.3.35: - resolution: {integrity: sha512-dNGfKCUSX2M4qVyaS80Lyos0FkXyHRCvrdQ2Y4Hrg3FVokiuw3yY6fLohpUfQ5ws3n2A39dh7jGDeh34+l0sGA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [win32] - requiresBuild: true optional: true /@swc/core-win32-arm64-msvc/1.3.36: @@ -2332,15 +2261,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: false - optional: true - - /@swc/core-win32-ia32-msvc/1.3.35: - resolution: {integrity: sha512-ChuPSrDR+JBf7S7dEKPicnG8A3bM0uWPsW2vG+V2wH4iNfNxKVemESHosmYVeEZXqMpomNMvLyeHep1rjRsc0Q==} - engines: {node: '>=10'} - cpu: [ia32] - os: [win32] - requiresBuild: true optional: true /@swc/core-win32-ia32-msvc/1.3.36: @@ -2349,15 +2269,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: false - optional: true - - /@swc/core-win32-x64-msvc/1.3.35: - resolution: {integrity: sha512-/RvphT4WfuGfIK84Ha0dovdPrKB1bW/mc+dtdmhv2E3EGkNc5FoueNwYmXWRimxnU7X0X7IkcRhyKB4G5DeAmg==} - engines: {node: '>=10'} - cpu: [x64] - os: [win32] - requiresBuild: true optional: true /@swc/core-win32-x64-msvc/1.3.36: @@ -2366,33 +2277,32 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: false optional: true - /@swc/core/1.3.35: - resolution: {integrity: sha512-KmiBin0XSVzJhzX19zTiCqmLslZ40Cl7zqskJcTDeIrRhfgKdiAsxzYUanJgMJIRjYtl9Kcg1V/Ip2o2wL8v3w==} + /@swc/core/1.3.36: + resolution: {integrity: sha512-Ogrd9uRNIj7nHjXxG66UlKBIcXESUenJ7OD6K2a8p82qlg6ne7Ne5Goiipm/heHYhSfVmjcnRWL9ZJ4gv+YCPA==} engines: {node: '>=10'} requiresBuild: true optionalDependencies: - '@swc/core-darwin-arm64': 1.3.35 - '@swc/core-darwin-x64': 1.3.35 - '@swc/core-linux-arm-gnueabihf': 1.3.35 - '@swc/core-linux-arm64-gnu': 1.3.35 - '@swc/core-linux-arm64-musl': 1.3.35 - '@swc/core-linux-x64-gnu': 1.3.35 - '@swc/core-linux-x64-musl': 1.3.35 - '@swc/core-win32-arm64-msvc': 1.3.35 - '@swc/core-win32-ia32-msvc': 1.3.35 - '@swc/core-win32-x64-msvc': 1.3.35 + '@swc/core-darwin-arm64': 1.3.36 + '@swc/core-darwin-x64': 1.3.36 + '@swc/core-linux-arm-gnueabihf': 1.3.36 + '@swc/core-linux-arm64-gnu': 1.3.36 + '@swc/core-linux-arm64-musl': 1.3.36 + '@swc/core-linux-x64-gnu': 1.3.36 + '@swc/core-linux-x64-musl': 1.3.36 + '@swc/core-win32-arm64-msvc': 1.3.36 + '@swc/core-win32-ia32-msvc': 1.3.36 + '@swc/core-win32-x64-msvc': 1.3.36 - /@swc/jest/0.2.24_@swc+core@1.3.35: + /@swc/jest/0.2.24_@swc+core@1.3.36: resolution: {integrity: sha512-fwgxQbM1wXzyKzl1+IW0aGrRvAA8k0Y3NxFhKigbPjOJ4mCKnWEcNX9HQS3gshflcxq8YKhadabGUVfdwjCr6Q==} engines: {npm: '>= 7.0.0'} peerDependencies: '@swc/core': '*' dependencies: '@jest/create-cache-key-function': 27.5.1 - '@swc/core': 1.3.35 + '@swc/core': 1.3.36 jsonc-parser: 3.2.0 dev: true @@ -3826,7 +3736,7 @@ packages: /axios/0.24.0: resolution: {integrity: sha512-Q6cWsys88HoPgAaFAVUb0WpPk0O8iTeisR9IMqy9G8AbO4NlpVknrnQS03zzF9PGAWgO3cgletO3VjV/P7VztA==} dependencies: - follow-redirects: 1.15.2_debug@4.3.4 + follow-redirects: 1.15.2 transitivePeerDependencies: - debug dev: false @@ -3834,7 +3744,7 @@ packages: /axios/0.27.2_debug@4.3.4: resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} dependencies: - follow-redirects: 1.15.2_debug@4.3.4 + follow-redirects: 1.15.2 form-data: 4.0.0 transitivePeerDependencies: - debug @@ -6606,7 +6516,7 @@ packages: readable-stream: 2.3.7 dev: false - /follow-redirects/1.15.2_debug@4.3.4: + /follow-redirects/1.15.2: resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} engines: {node: '>=4.0'} peerDependencies: @@ -6614,8 +6524,6 @@ packages: peerDependenciesMeta: debug: optional: true - dependencies: - debug: 4.3.4 /for-each/0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} @@ -13007,6 +12915,7 @@ packages: /vite/4.1.2_hlkwzk2izwsolfmdrejei4vrty: resolution: {integrity: sha512-MWDb9Rfy3DI8omDQySbMK93nQqStwbsQWejXRY2EBzEWKmLAXWb1mkI9Yw2IJrc+oCvPCI1Os5xSSIBYY6DEAw==} engines: {node: ^14.18.0 || >=16.0.0} + hasBin: true peerDependencies: '@types/node': '>= 14' less: '*' @@ -13086,6 +12995,7 @@ packages: /vue-tsc/1.1.4_typescript@4.9.5: resolution: {integrity: sha512-CMG8KZsBBPyulYie05XxJCfq/yAPiB/uMMeHmog09aLm2Kml82C6tUSRgQz8ujM4JoCrpDqVCd9G0NuM9aLt1g==} + hasBin: true peerDependencies: typescript: '*' dependencies: