Skip to content

chore: pick up the chat unread email notifications - #2

Merged
kenchou2006 merged 2 commits into
mainfrom
chat-unread-email-notifications
Sep 13, 2026
Merged

kenchou2006 merged 2 commits into
mainfrom
chat-unread-email-notifications

Conversation

@kenchou2006

@kenchou2006 kenchou2006 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

更新三個 submodule 的指標,帶進聊天未讀 email 通知。功能本身分散在三個 repo:

Repo PR 內容
CFEdgeChat CycleUni/CFEdgeChat#2 判斷收訊者是否在線、每個對話只通知一次的去重,並呼叫 Django
UniBooks-BE CycleUni/UniBooks-BE#2 產生並寄出信件、收件資格判斷;信件連結改帶區域前綴
UniBooks-FE CycleUni/UniBooks-FE#9 讓 hub 連線撐過 token 的兩小時(「這個人不在」就是以它為準),並修好沒有區域前綴的連結會把頁面弄丟的問題

行為

有新訊息時,若收訊者完全沒有連線到 CFEdgeChat(不是「沒打開那個對話」,是「沒打開網頁」),就寄一封通知信給他;在他點開那個對話之前,同一個對話的後續訊息不會再寄。

合併順序

先合三個 submodule 的 PR,再更新這裡的指標。 目前這個 commit 指向的是各 submodule 分支上的 SHA;submodule 分支合併後若被刪除,這些 SHA 會變成孤兒 commit。建議三個合完之後,在這個分支上把 submodule 指到各自 main 的新 commit 再合併。

功能相依上,CFEdgeChat 與 UniBooks-BE 需要一起上線才會真的寄信;兩者單獨部署都不會出錯(Worker 送出 Django 尚未認識的 event 會走既有分支,Django 端的新 handler 沒有 Worker 呼叫就不會被觸發)。

CFEdgeChat emails a recipient whose UserHub holds no connection when a
message arrives, once per conversation until they open it. UniBooks-BE
gains the webhook event that composes and sends that mail, and points
its email links at the region-prefixed frontend route. UniBooks-FE keeps
the hub connection alive past the token's two-hour expiry — which is
what "this user is away" is measured by — and stops the router throwing
away the page from any link that arrives without a region prefix.
Copilot AI lite review requested due to automatic review settings September 13, 2026 06:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

The previous commit pinned the feature-branch commits. The submodule PRs
were rebase-merged, which gave each change a new SHA on main with an
identical tree, so move the pointers there: the pinned commits are then
reachable from main rather than only from a branch that can be deleted.
@kenchou2006
kenchou2006 merged commit f6febd4 into main Sep 13, 2026
2 checks passed
@kenchou2006
kenchou2006 deleted the chat-unread-email-notifications branch September 13, 2026 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants