Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Improve Push Notification #7667

Merged
merged 522 commits into from
Apr 30, 2022
Merged

feat: Improve Push Notification #7667

merged 522 commits into from
Apr 30, 2022

Conversation

tamaina
Copy link
Contributor

@tamaina tamaina commented Aug 19, 2021

Summary

Resolve #6359, Resolve #6628, Resolve #6395

#7129 でgitの誤操作によりブランチが蒸発したため新規にPRを出します。
かなり長期間にわたっていますので、#7129も参照してください。

What

Service Workerのプッシュ通知を拡張し、actionsを用いて通知に反応できるようにします。
また、プッシュ通知まわりの挙動の整理もします。

Why

Service Workerのプッシュ通知でいろいろできるので

依存PR

Waiting to merge

#7605,

Merged

#7108, #7196, #7609, #7611, #7750, #7606, #7928, #7929

Changes

  • PushのデータにuserIdを追加して、通知を受け取るアカウントのIDを識別できるように
  • actions用にpostMessageでフォームを開いてWindowClient.focus()でタブを開く機能
  • actionsの実装・翻訳
  • ユーザー/グループとの会話がすべて既読になったらSW Pushに対してreadAllMessagingMessagesOfARoomを発行するように
  • 既存のタブで開く場合は、通常のページなのか、ウィンドウで開くかサイドビューで開くか、を判断するように
  • アプリが生成する通知をSWで受信できるようにする
  • package分離、ビルドはesbuildで

バグ(仕様です)

  1. pushが来て何も通知が出ないと「このサイトはバックグラウンドで更新されました」が出る
    • setTimeoutで消すようにはした
  2. WindowsのFirefoxだと、一定時間経過すると自動でclose()が発火するため、だいたいの通知が既読になってしまう
  3. プッシュ通知のペイロードが長すぎるとブラウザのプッシュ通知エンドポイントへ送信する際にエラーとなる
    • ペイロードを短くするようにした

将来的な拡張(今回のPRでは行わない)

@tamaina tamaina changed the title Swn feat: Improve Push Notification Aug 19, 2021
@tamaina tamaina marked this pull request as draft August 31, 2021 12:48
@tamaina
Copy link
Contributor Author

tamaina commented Sep 1, 2021

IndexedDBが何かの拍子に壊れるっぽくて頭を抱えている
(idb-keyvalを通して弄っているので不正な操作はしていないはず…

@tamaina
Copy link
Contributor Author

tamaina commented Sep 4, 2021

mark-all-as-read叩いてもインジケータが消えない

@tamaina
Copy link
Contributor Author

tamaina commented Sep 4, 2021

mark-all-as-read叩いてもインジケータが消えない

直した

IndexedDBが何かの拍子に壊れる

再現性がないのでとりあえずパス

@tamaina
Copy link
Contributor Author

tamaina commented Sep 4, 2021

直した

直ってないんじゃないかな

@tamaina

This comment has been minimized.

@tamaina

This comment has been minimized.

@tamaina tamaina requested a review from syuilo April 30, 2022 09:15
@syuilo syuilo merged commit 766559c into misskey-dev:develop Apr 30, 2022
@syuilo
Copy link
Member

syuilo commented Apr 30, 2022

🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants