Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

feat(notifications): mute status changes by default (MUL-9449) (#10778)

Jiayuan Zhang69c76cc2fe65
diff --git a/apps/docs/content/docs/github-integration.fr.mdx b/apps/docs/content/docs/github-integration.fr.mdx
index 4a9c8a363a..1fa949d1ac 100644
--- a/apps/docs/content/docs/github-integration.fr.mdx
+++ b/apps/docs/content/docs/github-integration.fr.mdx
@@ -111,7 +111,7 @@ La façon dont une PR a été associée ne change rien : le titre, le nom de bra
La vérification a lieu lorsqu'un événement de PR touche la tâche : une PR associée est fusionnée, une PR est associée, ou une association est retirée. Rouvrir une tâche ne la fait pas repasser au statut cible ; c'est la prochaine PR associée fusionnée qui le fait. Modifier le réglage ne change pas les tâches dont les PR ont été fusionnées auparavant.
-Le changement de statut est inscrit dans la chronologie comme une action système qui nomme les PR, et les membres abonnés à la tâche sont notifiés.
+Le changement de statut est inscrit dans la chronologie comme une action système qui nomme les PR, et les membres abonnés à la tâche sont notifiés s'ils ont activé les notifications de changement de statut.
## Plusieurs espaces de travail
diff --git a/apps/docs/content/docs/github-integration.ja.mdx b/apps/docs/content/docs/github-integration.ja.mdx
index 75e3c0e5f8..693683c1b5 100644
--- a/apps/docs/content/docs/github-integration.ja.mdx
+++ b/apps/docs/content/docs/github-integration.ja.mdx
@@ -109,7 +109,7 @@ PR の紐づけ方は結果に影響しません。タイトル、ブランチ
判定は PR イベントがタスクに関わったときだけ行います。紐づいた PR のマージ、紐づけの追加、紐づけの解除です。タスクを再度開いても元には戻らず、次に紐づいた PR がマージされたときに変更されます。設定を変えても、以前にマージされたタスクには影響しません。
-状態の変更は関連する PR を示したシステム操作としてタイムラインに記録され、そのタスクを購読しているメンバーへ通知されます。この設定は[セルフホスト Git ホスティング](/vcs-integration)を含むすべてのコードホストで共通です。
+状態の変更は関連する PR を示したシステム操作としてタイムラインに記録され、そのタスクを購読し、ステータス変更の通知をオンにしているメンバーへ通知されます。この設定は[セルフホスト Git ホスティング](/vcs-integration)を含むすべてのコードホストで共通です。
## 複数のワークスペース
diff --git a/apps/docs/content/docs/github-integration.ko.mdx b/apps/docs/content/docs/github-integration.ko.mdx
index bae43c3d9d..b55c3e974f 100644
--- a/apps/docs/content/docs/github-integration.ko.mdx
+++ b/apps/docs/content/docs/github-integration.ko.mdx
@@ -109,7 +109,7 @@ PR을 어떻게 연결했는지는 결과에 영향을 주지 않습니다. 제
판단은 PR 이벤트가 태스크에 닿을 때만 이루어집니다. 연결된 PR의 merge, 연결 추가, 연결 제거입니다. 태스크를 다시 열어도 원래대로 돌아가지 않으며, 다음에 연결된 PR이 merge될 때 바뀝니다. 설정을 바꿔도 이전에 merge된 태스크에는 영향을 주지 않습니다.
-상태 변경은 관련 PR을 적은 시스템 작업으로 타임라인에 기록되고 해당 태스크 구독자에게 알림이 전달됩니다. 이 설정은 [자체 호스팅 Git 코드 호스팅](/vcs-integration)을 포함한 모든 코드 호스트에 공통으로 적용됩니다.
+상태 변경은 관련 PR을 적은 시스템 작업으로 타임라인에 기록되고 상태 변경 알림을 켠 해당 태스크 구독자에게 알림이 전달됩니다. 이 설정은 [자체 호스팅 Git 코드 호스팅](/vcs-integration)을 포함한 모든 코드 호스트에 공통으로 적용됩니다.
## 여러 워크스페이스
diff --git a/apps/docs/content/docs/github-integration.mdx b/apps/docs/content/docs/github-integration.mdx
index adb69dc657..855d65bf20 100644
--- a/apps/docs/content/docs/github-integration.mdx
+++ b/apps/docs/content/docs/github-integration.mdx
@@ -111,7 +111,7 @@ How a PR was linked doesn't matter: the title, the branch name, and a `Closes MU
The check runs when a PR event touches the issue: a linked PR merges, a PR is linked, or a link is removed. Reopening an issue doesn't move it back; the next linked PR that merges does. Changing the setting doesn't move issues whose PRs merged earlier.
-The status change is written to the timeline as a system action naming the PRs, and members subscribed to the issue are notified.
+The status change is written to the timeline as a system action naming the PRs, and members subscribed to the issue are notified if they turned on status change notifications.
## Multiple workspaces
diff --git a/apps/docs/content/docs/github-integration.zh-Hant.mdx b/apps/docs/content/docs/github-integration.zh-Hant.mdx
index b585ab2c84..4ebc1de628 100644
--- a/apps/docs/content/docs/github-integration.zh-Hant.mdx
+++ b/apps/docs/content/docs/github-integration.zh-Hant.mdx
@@ -111,7 +111,7 @@ PR 是怎麼關聯上的,不影響結果:標題、分支名和正文裡的 `
只有 PR 事件會觸發判斷:關聯 PR 合併、新增關聯或移除關聯。重新開啟任務後,它不會被改回去,下一個關聯 PR 合併時才會。修改這項設定,也不會改動此前已合併的任務。
-狀態變化會以系統操作寫入時間線並列出相關 PR,訂閱該任務的成員會收到通知。
+狀態變化會以系統操作寫入時間線並列出相關 PR,訂閱該任務且開啟了狀態變更通知的成員會收到通知。
## 多個工作區
diff --git a/apps/docs/content/docs/github-integration.zh.mdx b/apps/docs/content/docs/github-integration.zh.mdx
index d900a95b99..87c286f4b4 100644
--- a/apps/docs/content/docs/github-integration.zh.mdx
+++ b/apps/docs/content/docs/github-integration.zh.mdx
@@ -111,7 +111,7 @@ PR 是怎么关联上的,不影响结果:标题、分支名和正文里的 `
只有 PR 事件会触发判断:关联 PR 合并、新增关联或移除关联。重新打开任务后,它不会被改回去,下一个关联 PR 合并时才会。修改这项设置,也不会改动此前已合并的任务。
-状态变化会以系统操作写入时间线并列出相关 PR,订阅该任务的成员会收到通知。
+状态变化会以系统操作写入时间线并列出相关 PR,订阅该任务且打开了状态变更通知的成员会收到通知。
## 多个工作区
diff --git a/apps/docs/content/docs/inbox.fr.mdx b/apps/docs/content/docs/inbox.fr.mdx
index a0b2532e43..d2b03d67a8 100644
--- a/apps/docs/content/docs/inbox.fr.mdx
+++ b/apps/docs/content/docs/inbox.fr.mdx
@@ -21,7 +21,8 @@ Sur téléphone, le panneau Travail se trouve dans le tiroir. Sa section Boîte
Les notifications courantes incluent :
- une tâche vous est assignée, ou vous est retirée ;
-- une tâche à laquelle vous êtes abonné reçoit un nouveau commentaire, ou son assigné, son statut, sa priorité ou ses dates changent (sur les tâches des autres, seulement les mises à jour clés par défaut ; voir plus bas) ;
+- une tâche à laquelle vous êtes abonné reçoit un nouveau commentaire, ou son assigné, sa priorité ou ses dates changent (sur les tâches des autres, seulement les mises à jour clés par défaut ; voir plus bas) ;
+- une tâche à laquelle vous êtes abonné change de statut, si vous avez activé **Changements de statut**, désactivé par défaut ;
- quelqu'un vous @mentionne dans la description ou un commentaire d'une tâche ;
- une tâche ou un commentaire que vous avez créé reçoit une réaction ;
- une exécution d'agent échoue sur une tâche à laquelle vous êtes abonné ;
@@ -44,12 +45,12 @@ Ces participants sont automatiquement abonnés à une tâche :
Changer l'assigné ne supprime pas les abonnements existants. Abonnez-vous ou désabonnez-vous à tout moment depuis la page de la tâche ; après le désabonnement, les mises à jour ordinaires n'arrivent plus dans votre boîte de réception, mais les @mentions directes vous notifient toujours individuellement.
<Callout type="info">
-Lorsque le statut d'une sous-tâche change, les abonnés de la tâche parente sont également notifiés. Les commentaires, la priorité et les changements de dates d'une sous-tâche ne remontent pas à la tâche parente.
+Avec **Changements de statut** activé, le changement de statut d'une sous-tâche notifie aussi les abonnés de la tâche parente. Les commentaires, la priorité et les changements de dates d'une sous-tâche ne remontent pas à la tâche parente.
</Callout>
## Tâches des autres
-Sur une tâche assignée à quelqu'un d'autre ou à son agent, un abonnement obtenu parce que vous l'avez créée, commentée ou y avez été mentionné n'apporte par défaut que les mises à jour clés : les @mentions, les réponses dans les fils auxquels vous avez participé et les statuts qui demandent une personne, comme `in_review`, `blocked` ou `done`. Les commentaires courants et les autres changements restent sur la tâche. Les tâches auxquelles vous vous êtes abonné vous-même, celles que vous suivez par leur projet et celles assignées à vous ou à vos agents apportent toujours toute l'activité.
+Sur une tâche assignée à quelqu'un d'autre ou à son agent, un abonnement obtenu parce que vous l'avez créée, commentée ou y avez été mentionné n'apporte par défaut que les mises à jour clés : les @mentions, les réponses dans les fils auxquels vous avez participé et, avec **Changements de statut** activé, les statuts qui demandent une personne, comme `in_review`, `blocked` ou `done`. Les commentaires courants et les autres changements restent sur la tâche. Les tâches auxquelles vous vous êtes abonné vous-même, celles que vous suivez par leur projet et celles assignées à vous ou à vos agents apportent toujours tous les types de notification que vous avez activés.
La page de la tâche signale un tel abonnement par **Mises à jour clés**. Son menu propose **Recevoir toute l'activité**, qui en fait un abonnement explicite à cette tâche ; il n'est ensuite plus possible de revenir aux mises à jour clés pour cette tâche, seulement de se désabonner. **Modifier la valeur par défaut** ouvre **Paramètres → Notifications**, où **Tâches des autres**, en tête de **Tâches que vous suivez**, fait passer toutes ces tâches à **Toute l'activité**.
@@ -145,7 +146,7 @@ En dessous, **Me notifier pour** active ou désactive chaque type de notificatio
| **Projets que vous suivez** | Nouvelles tâches |
| **Agents** | Activité des agents (exécutions en échec, et actions d'app demandées par un agent qui sont bloquées ou expirent) |
-Un type désactivé ne crée aucune notification, et le réactiver ne fait pas revenir ce que vous avez manqué ; les changements restent enregistrés sur la tâche. Quelques types, comme les résultats de création rapide et les mises en pause d'automatisation, ne relèvent pas de ces groupes et sont toujours envoyés. Les notifications système et du navigateur contrôlent les bannières sur le bureau et ne modifient pas la boîte de réception elle-même.
+**Changements de statut** est désactivé par défaut ; tous les autres types sont activés. Un type désactivé ne crée aucune notification, et le réactiver ne fait pas revenir ce que vous avez manqué ; les changements restent enregistrés sur la tâche. Quelques types, comme les résultats de création rapide et les mises en pause d'automatisation, ne relèvent pas de ces groupes et sont toujours envoyés. Les notifications système et du navigateur contrôlent les bannières sur le bureau et ne modifient pas la boîte de réception elle-même.
## Étapes suivantes
diff --git a/apps/docs/content/docs/inbox.ja.mdx b/apps/docs/content/docs/inbox.ja.mdx
index c5d916d841..c25052918a 100644
--- a/apps/docs/content/docs/inbox.ja.mdx
+++ b/apps/docs/content/docs/inbox.ja.mdx
@@ -21,7 +21,8 @@ import { InboxDemo } from "@/components/demos/inbox-demo";
主な通知は次のとおりです。
- タスクがあなたに割り当てられた、またはあなたから外された
-- 購読中のタスクに新しいコメントが付いた、または担当者・ステータス・優先度・日付が変わった(他の人のタスクは既定で重要な更新のみ。後述)
+- 購読中のタスクに新しいコメントが付いた、または担当者・優先度・日付が変わった(他の人のタスクは既定で重要な更新のみ。後述)
+- 購読中のタスクのステータスが変わった(既定でオフの **ステータス変更** をオンにした場合)
- タスクの説明やコメントで誰かがあなたを @メンションした
- あなたが作成したタスクやコメントにリアクションが付いた
- 購読中のタスクでエージェントの実行が失敗した
@@ -44,12 +45,12 @@ import { InboxDemo } from "@/components/demos/inbox-demo";
担当者が変わっても、既存の購読は解除されません。タスクのページでいつでも購読・購読解除できます。購読解除後は通常の更新はインボックスに届かなくなりますが、あなたへの直接の @メンションは引き続き個別に通知されます。
<Callout type="info">
-サブタスクのステータスが変わると、親タスクの購読者にも通知されます。サブタスクのコメント、優先度、日付の変更は親タスクには伝わりません。
+**ステータス変更** がオンなら、サブタスクのステータスが変わると親タスクの購読者にも通知されます。サブタスクのコメント、優先度、日付の変更は親タスクには伝わりません。
</Callout>
## 他の人のタスク
-他の人やその人のエージェントに割り当てられたタスクでは、作成・コメント・メンションによって自動的に購読した場合、既定で重要な更新だけが届きます。あなたへの @メンション、参加したスレッドへの返信、そして `in_review`・`blocked`・`done` など人の確認が必要なステータスです。通常のコメントやその他の変更はタスクに残ります。自分で購読したタスク、プロジェクト経由で購読しているタスク、あなたやあなたのエージェントに割り当てられたタスクには、引き続きすべてのアクティビティが届きます。
+他の人やその人のエージェントに割り当てられたタスクでは、作成・コメント・メンションによって自動的に購読した場合、既定で重要な更新だけが届きます。あなたへの @メンション、参加したスレッドへの返信、そして(**ステータス変更** がオンなら)`in_review`・`blocked`・`done` など人の確認が必要なステータスです。通常のコメントやその他の変更はタスクに残ります。自分で購読したタスク、プロジェクト経由で購読しているタスク、あなたやあなたのエージェントに割り当てられたタスクには、オンにしている種類の通知が引き続きすべて届きます。
タスクのページでは、こうした購読に **重要な更新のみ** と表示されます。メニューの **すべてのアクティビティを受け取る** を選ぶと、このタスクの明示的な購読に変わります。その後このタスクを重要な更新のみに戻す方法はなく、購読解除だけが可能です。**デフォルトを変更** は **設定 → 通知** を開きます。**購読中のタスク** の先頭にある **他の人のタスク** を **すべてのアクティビティ** にすると、こうしたタスクすべてにアクティビティが届くようになります。
@@ -145,7 +146,7 @@ multica inbox list --project <project-id> --type mentioned --output json
| **購読中のプロジェクト** | 新しいタスク |
| **エージェント** | エージェントのアクティビティ(実行の失敗、エージェントが求めたアプリ操作のブロックや期限切れ) |
-オフにした種類の通知は作られず、オンに戻しても見逃した分は戻りません。変更そのものはタスクに記録され続けます。エージェント経由の作成結果、オートパイロットの一時停止など一部のタイプはこれらのグループの対象外で、常に届きます。システム通知とブラウザ通知はデスクトップのバナーを制御するもので、インボックス自体は変わりません。
+**ステータス変更** は既定でオフ、ほかの種類は既定でオンです。オフにした種類の通知は作られず、オンに戻しても見逃した分は戻りません。変更そのものはタスクに記録され続けます。エージェント経由の作成結果、オートパイロットの一時停止など一部のタイプはこれらのグループの対象外で、常に届きます。システム通知とブラウザ通知はデスクトップのバナーを制御するもので、インボックス自体は変わりません。
## 次のステップ
diff --git a/apps/docs/content/docs/inbox.ko.mdx b/apps/docs/content/docs/inbox.ko.mdx
index 2965d01e98..e60c715a8f 100644
--- a/apps/docs/content/docs/inbox.ko.mdx
+++ b/apps/docs/content/docs/inbox.ko.mdx
@@ -21,7 +21,8 @@ import { InboxDemo } from "@/components/demos/inbox-demo";
일반적인 알림은 다음과 같습니다.
- 태스크가 나에게 할당되거나 내 할당에서 해제됨
-- 구독한 태스크에 새 댓글이 달리거나 담당자, 상태, 우선순위, 날짜가 변경됨(다른 사람의 태스크는 기본적으로 주요 업데이트만, 아래 참고)
+- 구독한 태스크에 새 댓글이 달리거나 담당자, 우선순위, 날짜가 변경됨(다른 사람의 태스크는 기본적으로 주요 업데이트만, 아래 참고)
+- 구독한 태스크의 상태가 변경됨(기본적으로 꺼져 있는 **상태 변경**을 켠 경우)
- 누군가 태스크 설명이나 댓글에서 나를 @멘션함
- 내가 만든 태스크나 댓글에 이모지 반응이 추가됨
- 구독한 태스크에서 에이전트의 실행이 실패함
@@ -44,12 +45,12 @@ import { InboxDemo } from "@/components/demos/inbox-demo";
담당자가 바뀌어도 기존 구독은 취소되지 않습니다. 태스크 페이지에서 언제든 구독하거나 구독을 취소할 수 있습니다. 취소하면 일반 업데이트는 더 이상 인박스에 들어오지 않지만 나를 직접 @멘션한 알림은 별도로 전달됩니다.
<Callout type="info">
-하위 태스크의 상태가 변경되면 상위 태스크 구독자에게도 알림이 갑니다. 하위 태스크의 댓글, 우선순위, 날짜 변경은 상위 태스크로 전달되지 않습니다.
+**상태 변경**을 켜 두면 하위 태스크의 상태 변경도 상위 태스크 구독자에게 알림이 갑니다. 하위 태스크의 댓글, 우선순위, 날짜 변경은 상위 태스크로 전달되지 않습니다.
</Callout>
## 다른 사람의 태스크
-다른 사람이나 그 사람의 에이전트에게 배정된 태스크에서, 만들거나 댓글을 달거나 멘션되어 자동으로 생긴 구독은 기본적으로 주요 업데이트만 전달합니다. 나를 향한 @멘션, 참여한 스레드의 답글, 그리고 `in_review`, `blocked`, `done`처럼 사람이 봐야 하는 상태입니다. 일반 댓글과 그 밖의 변경은 태스크에 남습니다. 직접 구독한 태스크, 프로젝트를 통해 구독한 태스크, 나 또는 내 에이전트에게 배정된 태스크는 계속 모든 활동을 받습니다.
+다른 사람이나 그 사람의 에이전트에게 배정된 태스크에서, 만들거나 댓글을 달거나 멘션되어 자동으로 생긴 구독은 기본적으로 주요 업데이트만 전달합니다. 나를 향한 @멘션, 참여한 스레드의 답글, 그리고 (**상태 변경**을 켠 경우) `in_review`, `blocked`, `done`처럼 사람이 봐야 하는 상태입니다. 일반 댓글과 그 밖의 변경은 태스크에 남습니다. 직접 구독한 태스크, 프로젝트를 통해 구독한 태스크, 나 또는 내 에이전트에게 배정된 태스크는 켜 둔 종류의 알림을 계속 모두 받습니다.
태스크 페이지는 이런 구독에 **주요 업데이트만**이라고 표시합니다. 메뉴에서 **모든 활동 받기**를 고르면 이 태스크에 대한 직접 구독으로 바뀌며, 이후 이 태스크를 주요 업데이트만으로 되돌릴 방법은 없고 구독 취소만 할 수 있습니다. **기본값 변경**은 **설정 → 알림**을 열며, **구독 중인 태스크** 맨 위의 **다른 사람의 태스크**를 **모든 활동**으로 바꾸면 이런 태스크 전부가 모든 활동을 받습니다.
@@ -145,7 +146,7 @@ multica inbox list --project <project-id> --type mentioned --output json
| **구독 중인 프로젝트** | 새 태스크 |
| **에이전트** | 에이전트 활동(실행 실패, 에이전트가 요청한 앱 작업의 차단이나 만료) |
-끈 종류의 알림은 만들어지지 않으며, 다시 켜도 놓친 알림은 돌아오지 않습니다. 변경 사항 자체는 태스크에 계속 기록됩니다. 빠른 생성 결과, 자동화 일시 중지 같은 일부 유형은 이 그룹들과 관계없이 항상 전달됩니다. 시스템 알림과 브라우저 알림 설정은 데스크톱 배너를 제어할 뿐 인박스 자체를 바꾸지 않습니다.
+**상태 변경**은 기본적으로 꺼져 있고 나머지 종류는 켜져 있습니다. 끈 종류의 알림은 만들어지지 않으며, 다시 켜도 놓친 알림은 돌아오지 않습니다. 변경 사항 자체는 태스크에 계속 기록됩니다. 빠른 생성 결과, 자동화 일시 중지 같은 일부 유형은 이 그룹들과 관계없이 항상 전달됩니다. 시스템 알림과 브라우저 알림 설정은 데스크톱 배너를 제어할 뿐 인박스 자체를 바꾸지 않습니다.
## 다음 단계
diff --git a/apps/docs/content/docs/inbox.mdx b/apps/docs/content/docs/inbox.mdx
index b608ea333d..be14b668d9 100644
--- a/apps/docs/content/docs/inbox.mdx
+++ b/apps/docs/content/docs/inbox.mdx
@@ -21,7 +21,8 @@ On a phone, the Work panel sits in the drawer. Its Inbox section ends with **All
Common notifications include:
- an issue is assigned to you, or moved away from you;
-- an issue you subscribe to gets a new comment, or its assignee, status, priority, or dates change (on other people's issues, only key updates by default; see below);
+- an issue you subscribe to gets a new comment, or its assignee, priority, or dates change (on other people's issues, only key updates by default; see below);
+- an issue you subscribe to changes status, once you turn on **Status changes**, which is off by default;
- someone @-mentions you in an issue description or comment;
- an issue or comment you created gets a reaction;
- an agent run fails on an issue you subscribe to;
@@ -44,12 +45,12 @@ These participants subscribe to an issue automatically:
Changing the assignee does not remove existing subscriptions. Subscribe or unsubscribe anytime on the issue page; after unsubscribing, ordinary updates stop reaching your inbox, while direct @-mentions still notify you individually.
<Callout type="info">
-When a sub-issue's status changes, subscribers of the parent issue are notified as well. Sub-issue comments, priority, and date changes do not bubble up to the parent.
+With **Status changes** on, a sub-issue's status change also notifies subscribers of the parent issue. Sub-issue comments, priority, and date changes do not bubble up to the parent.
</Callout>
## Other people's issues
-On an issue assigned to someone else or to their agent, a subscription you picked up by creating, commenting on, or being mentioned in it brings only key updates by default: @-mentions, replies in threads you took part in, and statuses that need a person, such as `in_review`, `blocked`, or `done`. Routine comments and other changes stay on the issue. Issues you subscribed to yourself, issues you follow through their project, and issues assigned to you or your agents still bring all activity.
+On an issue assigned to someone else or to their agent, a subscription you picked up by creating, commenting on, or being mentioned in it brings only key updates by default: @-mentions, replies in threads you took part in, and, with **Status changes** on, statuses that need a person, such as `in_review`, `blocked`, or `done`. Routine comments and other changes stay on the issue. Issues you subscribed to yourself, issues you follow through their project, and issues assigned to you or your agents still bring every kind of notification you have turned on.
The issue page marks such a subscription **Key updates only**. Its menu offers **Get all activity**, which turns it into an explicit subscription to this issue; there's no way back to key updates for that issue afterwards, only unsubscribing. **Change the default** opens **Settings → Notifications**, where **Other people's issues**, at the top of **Issues you subscribe to**, switches all such issues to **All activity**.
@@ -145,7 +146,7 @@ Below them, **Notify me about** turns each kind of notification on or off. These
| **Projects you subscribe to** | New issues |
| **Agents** | Agent activity (failed runs, and app actions an agent asked for that are blocked or expire) |
-A kind that's turned off creates no notification, and turning it back on doesn't bring back what you missed; the changes are still recorded on the issue. A few types, such as quick-create results and autopilot pauses, sit outside these groups and are always delivered. System and browser notifications control desktop banners and don't change the inbox itself.
+**Status changes** starts off; every other kind starts on. A kind that's turned off creates no notification, and turning it back on doesn't bring back what you missed; the changes are still recorded on the issue. A few types, such as quick-create results and autopilot pauses, sit outside these groups and are always delivered. System and browser notifications control desktop banners and don't change the inbox itself.
## Next steps
diff --git a/apps/docs/content/docs/inbox.zh-Hant.mdx b/apps/docs/content/docs/inbox.zh-Hant.mdx
index 5212a77912..17e976ac42 100644
--- a/apps/docs/content/docs/inbox.zh-Hant.mdx
+++ b/apps/docs/content/docs/inbox.zh-Hant.mdx
@@ -21,7 +21,8 @@ import { InboxDemo } from "@/components/demos/inbox-demo";
常見通知包括:
- 任務分配給你,或從你名下移走;
-- 你訂閱的任務出現新評論,或負責人、狀態、優先順序和日期發生變化(別人的任務預設只推送關鍵更新,見下文);
+- 你訂閱的任務出現新評論,或負責人、優先順序和日期發生變化(別人的任務預設只推送關鍵更新,見下文);
+- 你訂閱的任務狀態發生變化,前提是你開啟了預設關閉的**狀態變更**;
- 有人在任務描述或評論中 @你;
- 你建立的任務或評論收到表情回應;
- 你訂閱的任務中,AI 代理執行失敗;
@@ -44,12 +45,12 @@ import { InboxDemo } from "@/components/demos/inbox-demo";
負責人變更不會取消原有訂閱。可以在任務頁面隨時訂閱或取消;取消後普通更新不再進入收件箱,直接 @你仍會單獨通知。
<Callout type="info">
-子任務的狀態發生變化時,也會通知父任務的訂閱者。子任務的評論、優先順序和日期變化不會向父任務冒泡。
+開啟**狀態變更**後,子任務的狀態變化也會通知父任務的訂閱者。子任務的評論、優先順序和日期變化不會向父任務冒泡。
</Callout>
## 別人的任務
-任務指派給別人或別人的 AI 代理時,你因為建立、評論或被 @ 而自動產生的訂閱,預設只推送關鍵更新:@你、回覆你參與的討論,以及 `in_review`、`blocked`、`done` 等需要人來看的狀態。日常評論和其他變化留在任務裡。你手動訂閱的任務、透過專案訂閱的任務,以及指派給你或你的 AI 代理的任務,仍會收到全部動態。
+任務指派給別人或別人的 AI 代理時,你因為建立、評論或被 @ 而自動產生的訂閱,預設只推送關鍵更新:@你、回覆你參與的討論,以及(開啟**狀態變更**時)`in_review`、`blocked`、`done` 等需要人來看的狀態。日常評論和其他變化留在任務裡。你手動訂閱的任務、透過專案訂閱的任務,以及指派給你或你的 AI 代理的任務,仍會收到你開啟的所有通知類型。
任務頁面會把這類訂閱標為**僅關鍵更新**。點開後選**接收全部動態**,會把它變為對這個任務的手動訂閱;之後這個任務無法再退回僅關鍵更新,只能取消訂閱。**修改預設設定**會打開**設定 → 通知**,把**你訂閱的任務**分組頂部的**別人的任務**改為**全部動態**,所有這類任務都會推送全部動態。
@@ -145,7 +146,7 @@ multica inbox list --project <project-id> --type mentioned --output json
| **你訂閱的專案** | 新任務 |
| **AI 代理** | AI 代理活動(執行失敗,以及 AI 代理請求的應用操作被攔截或過期) |
-關閉某一類後,不再建立這類通知,重新開啟也不會補回錯過的通知;相關變化仍然儲存在任務中。快速建立結果和自動化暫停等少數類型不受這些分組控制,始終投遞。系統通知和瀏覽器通知控制的是桌面橫幅,不會改變收件箱本身。
+**狀態變更**預設關閉,其餘類型預設開啟。關閉某一類後,不再建立這類通知,重新開啟也不會補回錯過的通知;相關變化仍然儲存在任務中。快速建立結果和自動化暫停等少數類型不受這些分組控制,始終投遞。系統通知和瀏覽器通知控制的是桌面橫幅,不會改變收件箱本身。
## 接下來
diff --git a/apps/docs/content/docs/inbox.zh.mdx b/apps/docs/content/docs/inbox.zh.mdx
index 4120293436..ee1927dd5b 100644
--- a/apps/docs/content/docs/inbox.zh.mdx
+++ b/apps/docs/content/docs/inbox.zh.mdx
@@ -21,7 +21,8 @@ import { InboxDemo } from "@/components/demos/inbox-demo";
常见通知包括:
- 任务分配给你,或从你名下移走;
-- 你订阅的任务出现新评论,或负责人、状态、优先级和日期发生变化(别人的任务默认只推送关键更新,见下文);
+- 你订阅的任务出现新评论,或负责人、优先级和日期发生变化(别人的任务默认只推送关键更新,见下文);
+- 你订阅的任务状态发生变化,前提是你打开了默认关闭的**状态变更**;
- 有人在任务描述或评论中 @你;
- 你创建的任务或评论收到表情回应;
- 你订阅的任务中,智能体运行失败;
@@ -44,12 +45,12 @@ import { InboxDemo } from "@/components/demos/inbox-demo";
负责人变更不会取消原有订阅。可以在任务页面随时订阅或取消;取消后普通更新不再进入收件箱,直接 @你仍会单独通知。
<Callout type="info">
-子任务的状态发生变化时,也会通知父任务的订阅者。子任务的评论、优先级和日期变化不会向父任务冒泡。
+打开**状态变更**后,子任务的状态变化也会通知父任务的订阅者。子任务的评论、优先级和日期变化不会向父任务冒泡。
</Callout>
## 别人的任务
-任务分配给别人或别人的智能体时,你因为创建、评论或被 @ 而自动产生的订阅,默认只推送关键更新:@你、回复你参与的讨论,以及 `in_review`、`blocked`、`done` 等需要人来看的状态。日常评论和其他变化留在任务里。你手动订阅的任务、通过项目订阅的任务,以及分配给你或你的智能体的任务,仍会收到全部动态。
+任务分配给别人或别人的智能体时,你因为创建、评论或被 @ 而自动产生的订阅,默认只推送关键更新:@你、回复你参与的讨论,以及(打开**状态变更**时)`in_review`、`blocked`、`done` 等需要人来看的状态。日常评论和其他变化留在任务里。你手动订阅的任务、通过项目订阅的任务,以及分配给你或你的智能体的任务,仍会收到你打开的所有通知类型。
任务页面会把这类订阅标为**仅关键更新**。点开后选**接收全部动态**,会把它变为对这个任务的手动订阅;之后这个任务无法再退回仅关键更新,只能取消订阅。**修改默认设置**会打开**设置 → 通知**,把**你订阅的任务**分组顶部的**别人的任务**改为**全部动态**,所有这类任务都会推送全部动态。
@@ -145,7 +146,7 @@ multica inbox list --project <project-id> --type mentioned --output json
| **你订阅的项目** | 新任务 |
| **智能体** | 智能体活动(运行失败,以及智能体请求的应用操作被拦截或过期) |
-关闭某一类后,不再创建这类通知,重新打开也不会补回错过的通知;相关变化仍然保存在任务中。快速创建结果和自动化暂停等少数类型不受这些分组控制,始终投递。系统通知和浏览器通知控制的是桌面横幅,不会改变收件箱本身。
+**状态变更**默认关闭,其余类型默认打开。关闭某一类后,不再创建这类通知,重新打开也不会补回错过的通知;相关变化仍然保存在任务中。快速创建结果和自动化暂停等少数类型不受这些分组控制,始终投递。系统通知和浏览器通知控制的是桌面横幅,不会改变收件箱本身。
## 接下来
diff --git a/apps/mobile/app/(app)/[workspace]/more/settings/notifications.tsx b/apps/mobile/app/(app)/[workspace]/more/settings/notifications.tsx
index 40db214618..081e49b4e5 100644
--- a/apps/mobile/app/(app)/[workspace]/more/settings/notifications.tsx
+++ b/apps/mobile/app/(app)/[workspace]/more/settings/notifications.tsx
@@ -12,6 +12,7 @@ import type {
NotificationGroupKey,
NotificationPreferences,
} from "@multica/core/types";
+import { notificationPreferenceValue } from "@multica/core/notification-preferences/patch";
import { Text } from "@/components/ui/text";
import { Switch } from "@/components/ui/switch";
import { Separator } from "@/components/ui/separator";
@@ -77,13 +78,10 @@ export default function NotificationsSettingsScreen() {
const preferences: NotificationPreferences = data?.preferences ?? {};
const onToggle = (key: NotificationGroupKey, enabled: boolean) => {
- const next: NotificationPreferences = { ...preferences };
- if (enabled) {
- // Default is "all" — omitting the key keeps the object clean.
- delete next[key];
- } else {
- next[key] = "muted";
- }
+ const next: NotificationPreferences = {
+ ...preferences,
+ [key]: enabled ? "all" : "muted",
+ };
mutation.mutate(next);
};
@@ -116,7 +114,8 @@ export default function NotificationsSettingsScreen() {
title={t("groups.inbox_notifications")}
>
{INBOX_GROUPS.map((group, idx) => {
- const enabled = preferences[group.key] !== "muted";
+ const enabled =
+ notificationPreferenceValue(preferences, group.key) !== "muted";
const isLast = idx === INBOX_GROUPS.length - 1;
return (
<View key={group.key}>
diff --git a/packages/core/notification-preferences/mutations.test.tsx b/packages/core/notification-preferences/mutations.test.tsx
index 87c1a7172b..ce2027900f 100644
--- a/packages/core/notification-preferences/mutations.test.tsx
+++ b/packages/core/notification-preferences/mutations.test.tsx
@@ -103,7 +103,7 @@ describe("useUpdateNotificationPreferences", () => {
queryClient.setQueryData(notificationPreferenceKeys.all(WORKSPACE_ID), {
workspace_id: WORKSPACE_ID,
preferences: {
- status_changes: "muted",
+ assignments: "muted",
comments: "muted",
},
});
@@ -118,7 +118,7 @@ describe("useUpdateNotificationPreferences", () => {
await waitFor(() => {
expect(updateNotificationPreferences).toHaveBeenCalledWith(
- { status_changes: "all" },
+ { assignments: "all" },
WORKSPACE_SLUG,
);
});
@@ -170,14 +170,14 @@ describe("useUpdateNotificationPreferences", () => {
);
act(() => {
- result.current.mutate({ status_changes: "muted" });
+ result.current.mutate({ assignments: "muted" });
});
await waitFor(() => {
expect(
queryClient.getQueryData<NotificationPreferenceResponse>(
notificationPreferenceKeys.all(WORKSPACE_ID),
)?.preferences,
- ).toEqual({ status_changes: "muted" });
+ ).toEqual({ assignments: "muted" });
});
rerender();
@@ -198,13 +198,13 @@ describe("useUpdateNotificationPreferences", () => {
rerender();
first.resolve({
workspace_id: WORKSPACE_ID,
- preferences: { status_changes: "muted" },
+ preferences: { assignments: "muted" },
});
await waitFor(() => {
expect(updateNotificationPreferences).toHaveBeenCalledTimes(2);
});
expect(updateNotificationPreferences.mock.calls[1]).toEqual([
- { status_changes: "all" },
+ { assignments: "all" },
WORKSPACE_SLUG,
]);
diff --git a/packages/core/notification-preferences/patch.test.ts b/packages/core/notification-preferences/patch.test.ts
index 9d8ef4c614..479f555d18 100644
--- a/packages/core/notification-preferences/patch.test.ts
+++ b/packages/core/notification-preferences/patch.test.ts
@@ -29,10 +29,33 @@ describe("notification preference patches", () => {
it("uses an explicit all value when enabling a previously muted group", () => {
expect(
deriveNotificationPreferencePatch(
- { status_changes: "muted", comments: "muted" },
+ { updates: "muted", comments: "muted" },
{ comments: "muted" },
),
+ ).toEqual({ updates: "all" });
+ });
+
+ it("treats a missing status_changes as muted, so turning it on is stored", () => {
+ expect(notificationPreferenceValue({}, "status_changes")).toBe("muted");
+ expect(
+ deriveNotificationPreferencePatch({}, { status_changes: "all" }),
).toEqual({ status_changes: "all" });
+ // The server echoes the default explicitly; enabling from there is the same patch.
+ expect(
+ deriveNotificationPreferencePatch({ status_changes: "muted" }, { status_changes: "all" }),
+ ).toEqual({ status_changes: "all" });
+ expect(
+ deriveNotificationPreferencePatch({ status_changes: "all" }, {}),
+ ).toEqual({ status_changes: "muted" });
+ expect(
+ applyNotificationPreferencePatch({}, { status_changes: "all" }),
+ ).toEqual({ status_changes: "all" });
+ expect(
+ applyNotificationPreferencePatch({ status_changes: "all" }, { status_changes: "muted" }),
+ ).toEqual({});
+ expect(
+ rollbackNotificationPreferencePatch({ status_changes: "all" }, { status_changes: "all" }, {}),
+ ).toEqual({});
});
it("merges optimistic patches without dropping unrelated preferences", () => {
diff --git a/packages/core/notification-preferences/patch.ts b/packages/core/notification-preferences/patch.ts
index 40d0b2a683..77f4fe0182 100644
--- a/packages/core/notification-preferences/patch.ts
+++ b/packages/core/notification-preferences/patch.ts
@@ -5,11 +5,12 @@ type PreferenceValues = Record<PreferenceKey, string | undefined>;
/**
* The value each key means when it is missing. Every key the settings UI can
- * write must be listed, or its change is silently never sent.
+ * write must be listed, or its change is silently never sent. Must match the
+ * server's defaults (`mutedByDefault` in server/internal/inbox/registry.go).
*/
const PREFERENCE_DEFAULTS: { [K in PreferenceKey]-?: NonNullable<NotificationPreferences[K]> } = {
assignments: "all",
- status_changes: "all",
+ status_changes: "muted",
comments: "all",
chat_replies: "all",
mentions: "all",
diff --git a/packages/views/layout/panels/section-settings.test.tsx b/packages/views/layout/panels/section-settings.test.tsx
index cf80db30fe..b822b4bd00 100644
--- a/packages/views/layout/panels/section-settings.test.tsx
+++ b/packages/views/layout/panels/section-settings.test.tsx
@@ -65,10 +65,11 @@ describe("InboxSectionSettings", () => {
fireEvent.click(screen.getByRole("button", { name: "Inbox display" }));
}
- it("shows each notification kind as delivered unless muted", () => {
+ it("shows each notification kind as delivered unless muted, status changes off by default", () => {
open();
expect(toggle("Comments")).not.toBeChecked();
expect(toggle("Mentions")).toBeChecked();
+ expect(toggle("Status changes")).not.toBeChecked();
});
it("mutes a kind at write time through the notification preferences", () => {
@@ -77,10 +78,19 @@ describe("InboxSectionSettings", () => {
expect(preferences.mutate).toHaveBeenCalledWith({ comments: "muted", mentions: "muted" }, expect.anything());
});
- it("drops a kind from the stored preferences when it is turned back on", () => {
+ it("turns a kind back on", () => {
open();
fireEvent.click(toggle("Comments"));
- expect(preferences.mutate).toHaveBeenCalledWith({}, expect.anything());
+ expect(preferences.mutate).toHaveBeenCalledWith({ comments: "all" }, expect.anything());
+ });
+
+ it("turns status changes on", () => {
+ open();
+ fireEvent.click(toggle("Status changes"));
+ expect(preferences.mutate).toHaveBeenCalledWith(
+ { comments: "muted", status_changes: "all" },
+ expect.anything(),
+ );
});
it("turns off the section count and the Work badge", () => {
diff --git a/packages/views/layout/panels/sidebar-settings.tsx b/packages/views/layout/panels/sidebar-settings.tsx
index fc8e3555b0..a374aae7bf 100644
--- a/packages/views/layout/panels/sidebar-settings.tsx
+++ b/packages/views/layout/panels/sidebar-settings.tsx
@@ -27,6 +27,7 @@ import {
} from "@multica/core/issues/stores/sidebar-tree-store";
import { notificationPreferenceOptions } from "@multica/core/notification-preferences/queries";
import { useUpdateNotificationPreferences } from "@multica/core/notification-preferences/mutations";
+import { notificationPreferenceValue } from "@multica/core/notification-preferences/patch";
import { useWorkspacePaths } from "@multica/core/paths";
import { PROJECT_STATUS_CONFIG, PROJECT_STATUS_ORDER } from "@multica/core/projects/config";
import type { NotificationGroupKey, NotificationPreferences, ProjectStatus } from "@multica/core/types";
@@ -401,8 +402,6 @@ function InboxNotificationTypes() {
const preferences = data?.preferences ?? {};
const toggleGroup = (key: NotificationGroupKey, enabled: boolean) => {
const next: NotificationPreferences = { ...preferences, [key]: enabled ? "all" : "muted" };
- // "all" is the default; the stored object keeps only muted kinds.
- if (enabled) delete next[key];
updatePreferences.mutate(next, {
onError: (err) =>
toast.error(err instanceof Error && err.message ? err.message : ts(($) => $.notifications.toast_failed)),
@@ -419,7 +418,7 @@ function InboxNotificationTypes() {
<SwitchField
key={key}
label={ts(($) => $.notifications.groups[key].label)}
- checked={preferences[key] !== "muted"}
+ checked={notificationPreferenceValue(preferences, key) !== "muted"}
onChange={(enabled) => toggleGroup(key, enabled)}
/>
))}
diff --git a/packages/views/locales/en/issues.json b/packages/views/locales/en/issues.json
index 822bf44e55..44024131f0 100644
--- a/packages/views/locales/en/issues.json
+++ b/packages/views/locales/en/issues.json
@@ -558,9 +558,9 @@
"subscribe": "Subscribe",
"unsubscribe": "Unsubscribe",
"delegated_subscription_badge": "Watching via agent",
- "delegated_subscription_hint": "Your agent created this issue on your behalf, so you're subscribed to it. You'll get notified when it needs review, finishes, or gets stuck.",
+ "delegated_subscription_hint": "Your agent created this issue on your behalf, so you're subscribed to it. With Status changes on, you'll get notified when it needs review, finishes, or gets stuck.",
"key_updates_subscription_badge": "Key updates only",
- "key_updates_subscription_hint": "This issue is someone else's, and you follow it because you created, commented on or were mentioned in it. You'll hear about @mentions, replies in your threads, and when it needs review, gets stuck or finishes.",
+ "key_updates_subscription_hint": "This issue is someone else's, and you follow it because you created, commented on or were mentioned in it. You'll hear about @mentions, replies in your threads, and, with Status changes on, when it needs review, gets stuck or finishes.",
"key_updates_follow_all": "Get all activity",
"key_updates_follow_all_done": "You'll get all activity on this issue",
"key_updates_settings": "Change the default",
diff --git a/packages/views/locales/en/settings.json b/packages/views/locales/en/settings.json
index df4cc5143d..00b8c88f27 100644
--- a/packages/views/locales/en/settings.json
+++ b/packages/views/locales/en/settings.json
@@ -850,7 +850,7 @@
},
"others_issues": {
"label": "Other people's issues",
- "description": "Issues assigned to someone else or their agent, that you only follow because you created, commented on or were mentioned in them. Key updates are @mentions, replies in threads you joined, and statuses that need a person, like in review, blocked or done.",
+ "description": "Issues assigned to someone else or their agent, that you only follow because you created, commented on or were mentioned in them. Key updates are @mentions, replies in threads you joined, and, with Status changes on, statuses that need a person, like in review, blocked or done.",
"key_updates": "Key updates only",
"all": "All activity"
},
diff --git a/packages/views/locales/es/issues.json b/packages/views/locales/es/issues.json
index a3d07ee7ec..05bf496487 100644
--- a/packages/views/locales/es/issues.json
+++ b/packages/views/locales/es/issues.json
@@ -527,9 +527,9 @@
"subscribe": "Suscribirse",
"unsubscribe": "Darse de baja",
"delegated_subscription_badge": "Observando a través de un agente",
- "delegated_subscription_hint": "Tu agente creó esta tarea en tu nombre, así que estás suscrito. Recibirás una notificación cuando necesite revisión, termine o se quede atascada.",
+ "delegated_subscription_hint": "Tu agente creó esta tarea en tu nombre, así que estás suscrito. Con Cambios de estado activado, recibirás una notificación cuando necesite revisión, termine o se quede atascada.",
"key_updates_subscription_badge": "Solo actualizaciones clave",
- "key_updates_subscription_hint": "Esta tarea es de otra persona y la sigues porque la creaste, la comentaste o te mencionaron. Recibirás las @menciones, las respuestas en tus hilos y los avisos cuando necesite revisión, se bloquee o termine.",
+ "key_updates_subscription_hint": "Esta tarea es de otra persona y la sigues porque la creaste, la comentaste o te mencionaron. Recibirás las @menciones, las respuestas en tus hilos y, con Cambios de estado activado, los avisos cuando necesite revisión, se bloquee o termine.",
"key_updates_follow_all": "Recibir toda la actividad",
"key_updates_follow_all_done": "Recibirás toda la actividad de esta tarea",
"key_updates_settings": "Cambiar el valor predeterminado",
diff --git a/packages/views/locales/es/settings.json b/packages/views/locales/es/settings.json
index b50956db9f..7d91483086 100644
--- a/packages/views/locales/es/settings.json
+++ b/packages/views/locales/es/settings.json
@@ -850,7 +850,7 @@
},
"others_issues": {
"label": "Tareas de otras personas",
- "description": "Tareas asignadas a otra persona o a su agente, que sigues solo porque las creaste, comentaste o te mencionaron. Las actualizaciones clave son las @menciones, las respuestas en hilos en los que participaste y los estados que necesitan a una persona, como en revisión, bloqueada o terminada.",
+ "description": "Tareas asignadas a otra persona o a su agente, que sigues solo porque las creaste, comentaste o te mencionaron. Las actualizaciones clave son las @menciones, las respuestas en hilos en los que participaste y, con Cambios de estado activado, los estados que necesitan a una persona, como en revisión, bloqueada o terminada.",
"key_updates": "Solo actualizaciones clave",
"all": "Toda la actividad"
},
diff --git a/packages/views/locales/fr/issues.json b/packages/views/locales/fr/issues.json
index b51836c8b6..aa86cacc97 100644
--- a/packages/views/locales/fr/issues.json
+++ b/packages/views/locales/fr/issues.json
@@ -558,9 +558,9 @@
"subscribe": "S'abonner",
"unsubscribe": "Se désabonner",
"delegated_subscription_badge": "Suivi via un agent",
- "delegated_subscription_hint": "Votre agent a créé cette tâche en votre nom : vous y êtes donc abonné. Vous serez notifié lorsqu'elle demandera une relecture, se terminera ou se bloquera.",
+ "delegated_subscription_hint": "Votre agent a créé cette tâche en votre nom : vous y êtes donc abonné. Avec Changements de statut activé, vous serez notifié lorsqu'elle demandera une relecture, se terminera ou se bloquera.",
"key_updates_subscription_badge": "Mises à jour clés",
- "key_updates_subscription_hint": "Cette tâche est celle de quelqu'un d'autre, et vous la suivez parce que vous l'avez créée, commentée ou y avez été mentionné. Vous recevrez les @mentions, les réponses dans vos fils, et les alertes quand elle demande une relecture, se bloque ou se termine.",
+ "key_updates_subscription_hint": "Cette tâche est celle de quelqu'un d'autre, et vous la suivez parce que vous l'avez créée, commentée ou y avez été mentionné. Vous recevrez les @mentions, les réponses dans vos fils et, avec Changements de statut activé, les alertes quand elle demande une relecture, se bloque ou se termine.",
"key_updates_follow_all": "Recevoir toute l'activité",
"key_updates_follow_all_done": "Vous recevrez toute l'activité de cette tâche",
"key_updates_settings": "Modifier la valeur par défaut",
diff --git a/packages/views/locales/fr/settings.json b/packages/views/locales/fr/settings.json
index b34dae5aef..3c00f03d49 100644
--- a/packages/views/locales/fr/settings.json
+++ b/packages/views/locales/fr/settings.json
@@ -850,7 +850,7 @@
},
"others_issues": {
"label": "Tâches des autres",
- "description": "Tâches assignées à quelqu'un d'autre ou à son agent, que vous suivez seulement parce que vous les avez créées, commentées ou y avez été mentionné. Les mises à jour clés sont les @mentions, les réponses dans les fils auxquels vous avez participé et les statuts qui demandent une personne, comme en relecture, bloquée ou terminée.",
+ "description": "Tâches assignées à quelqu'un d'autre ou à son agent, que vous suivez seulement parce que vous les avez créées, commentées ou y avez été mentionné. Les mises à jour clés sont les @mentions, les réponses dans les fils auxquels vous avez participé et, avec Changements de statut activé, les statuts qui demandent une personne, comme en relecture, bloquée ou terminée.",
"key_updates": "Mises à jour clés",
"all": "Toute l'activité"
},
diff --git a/packages/views/locales/ja/issues.json b/packages/views/locales/ja/issues.json
index e3c2ca4cfa..34ac890c5d 100644
--- a/packages/views/locales/ja/issues.json
+++ b/packages/views/locales/ja/issues.json
@@ -550,9 +550,9 @@
"subscribe": "購読",
"unsubscribe": "購読解除",
"delegated_subscription_badge": "エージェント経由で購読中",
- "delegated_subscription_hint": "エージェントがあなたに代わってこのタスクを作成したため、購読しています。レビュー待ち・完了・ブロック時に通知されます。",
+ "delegated_subscription_hint": "エージェントがあなたに代わってこのタスクを作成したため、購読しています。ステータス変更がオンなら、レビュー待ち・完了・ブロック時に通知されます。",
"key_updates_subscription_badge": "重要な更新のみ",
- "key_updates_subscription_hint": "他の人が担当するタスクで、作成・コメント・メンションによって購読しています。あなたへの @メンション、参加したスレッドへの返信、レビュー待ち・ブロック・完了のときだけ通知されます。",
+ "key_updates_subscription_hint": "他の人が担当するタスクで、作成・コメント・メンションによって購読しています。あなたへの @メンション、参加したスレッドへの返信、そしてステータス変更がオンならレビュー待ち・ブロック・完了のときだけ通知されます。",
"key_updates_follow_all": "すべてのアクティビティを受け取る",
"key_updates_follow_all_done": "このタスクのすべてのアクティビティを受け取ります",
"key_updates_settings": "デフォルトを変更",
diff --git a/packages/views/locales/ja/settings.json b/packages/views/locales/ja/settings.json
index 82e6350ea2..1e92661713 100644
--- a/packages/views/locales/ja/settings.json
+++ b/packages/views/locales/ja/settings.json
@@ -841,7 +841,7 @@
},
"others_issues": {
"label": "他の人のタスク",
- "description": "他の人やその人のエージェントに割り当てられたタスクで、作成・コメント・メンションによって自動的に購読しているもの。重要な更新とは、あなたへの @メンション、参加したスレッドへの返信、レビュー待ち・ブロック・完了など人の確認が必要なステータスです。",
+ "description": "他の人やその人のエージェントに割り当てられたタスクで、作成・コメント・メンションによって自動的に購読しているもの。重要な更新とは、あなたへの @メンション、参加したスレッドへの返信、そしてステータス変更がオンならレビュー待ち・ブロック・完了など人の確認が必要なステータスです。",
"key_updates": "重要な更新のみ",
"all": "すべてのアクティビティ"
},
diff --git a/packages/views/locales/ko/issues.json b/packages/views/locales/ko/issues.json
index e7ca694c28..1b0fed4197 100644
--- a/packages/views/locales/ko/issues.json
+++ b/packages/views/locales/ko/issues.json
@@ -550,9 +550,9 @@
"subscribe": "구독",
"unsubscribe": "구독 해제",
"delegated_subscription_badge": "에이전트를 통해 구독 중",
- "delegated_subscription_hint": "에이전트가 회원님을 대신해 이 태스크를 만들었기 때문에 구독 중입니다. 검토 필요, 완료, 차단 시 알림을 받습니다.",
+ "delegated_subscription_hint": "에이전트가 회원님을 대신해 이 태스크를 만들었기 때문에 구독 중입니다. 상태 변경을 켜 두면 검토 필요, 완료, 차단 시 알림을 받습니다.",
"key_updates_subscription_badge": "주요 업데이트만",
- "key_updates_subscription_hint": "다른 사람이 맡은 태스크이며, 만들거나 댓글을 달거나 멘션되어 구독 중입니다. 나를 향한 @멘션, 참여한 스레드의 답글, 그리고 검토 필요·차단·완료 시에만 알림을 받습니다.",
+ "key_updates_subscription_hint": "다른 사람이 맡은 태스크이며, 만들거나 댓글을 달거나 멘션되어 구독 중입니다. 나를 향한 @멘션, 참여한 스레드의 답글, 그리고 상태 변경을 켠 경우 검토 필요·차단·완료 시에만 알림을 받습니다.",
"key_updates_follow_all": "모든 활동 받기",
"key_updates_follow_all_done": "이 태스크의 모든 활동을 받습니다",
"key_updates_settings": "기본값 변경",
diff --git a/packages/views/locales/ko/settings.json b/packages/views/locales/ko/settings.json
index 5bbc52e81f..242633d859 100644
--- a/packages/views/locales/ko/settings.json
+++ b/packages/views/locales/ko/settings.json
@@ -841,7 +841,7 @@
},
"others_issues": {
"label": "다른 사람의 태스크",
- "description": "다른 사람이나 그 사람의 에이전트에게 배정된 태스크 중, 만들거나 댓글을 달거나 멘션되어 자동으로 구독한 것. 주요 업데이트는 나를 향한 @멘션, 참여한 스레드의 답글, 그리고 검토 필요·차단·완료처럼 사람이 봐야 하는 상태입니다.",
+ "description": "다른 사람이나 그 사람의 에이전트에게 배정된 태스크 중, 만들거나 댓글을 달거나 멘션되어 자동으로 구독한 것. 주요 업데이트는 나를 향한 @멘션, 참여한 스레드의 답글, 그리고 상태 변경을 켠 경우 검토 필요·차단·완료처럼 사람이 봐야 하는 상태입니다.",
"key_updates": "주요 업데이트만",
"all": "모든 활동"
},
diff --git a/packages/views/locales/ru/issues.json b/packages/views/locales/ru/issues.json
index d277c89998..1e91644048 100644
--- a/packages/views/locales/ru/issues.json
+++ b/packages/views/locales/ru/issues.json
@@ -568,9 +568,9 @@
"subscribe": "Подписаться",
"unsubscribe": "Отписаться",
"delegated_subscription_badge": "Отслеживается через агента",
- "delegated_subscription_hint": "Ваш агент создал эту задачу от вашего имени, поэтому вы на неё подписаны. Вы получите уведомление, когда потребуется проверка, работа завершится или возникнет затруднение.",
+ "delegated_subscription_hint": "Ваш агент создал эту задачу от вашего имени, поэтому вы на неё подписаны. Если включены изменения статуса, вы получите уведомление, когда потребуется проверка, работа завершится или возникнет затруднение.",
"key_updates_subscription_badge": "Только ключевые",
- "key_updates_subscription_hint": "Это чужая задача, и вы подписаны на неё, потому что создали её, комментировали или были упомянуты. Вы получите @упоминания, ответы в ваших обсуждениях и уведомления, когда потребуется проверка, возникнет затруднение или работа завершится.",
+ "key_updates_subscription_hint": "Это чужая задача, и вы подписаны на неё, потому что создали её, комментировали или были упомянуты. Вы получите @упоминания, ответы в ваших обсуждениях и, если включены изменения статуса, уведомления, когда потребуется проверка, возникнет затруднение или работа завершится.",
"key_updates_follow_all": "Получать все события",
"key_updates_follow_all_done": "Вы будете получать все события этой задачи",
"key_updates_settings": "Изменить по умолчанию",
diff --git a/packages/views/locales/ru/settings.json b/packages/views/locales/ru/settings.json
index 91ea25ff1d..0ba953f51f 100644
--- a/packages/views/locales/ru/settings.json
+++ b/packages/views/locales/ru/settings.json
@@ -867,7 +867,7 @@
},
"others_issues": {
"label": "Чужие задачи",
- "description": "Задачи, назначенные другому человеку или его агенту, на которые вы подписаны только потому, что создали их, комментировали или были упомянуты. Ключевые обновления — это @упоминания, ответы в обсуждениях с вашим участием и статусы, которым нужен человек: на проверке, заблокирована, готово.",
+ "description": "Задачи, назначенные другому человеку или его агенту, на которые вы подписаны только потому, что создали их, комментировали или были упомянуты. Ключевые обновления — это @упоминания, ответы в обсуждениях с вашим участием и, если включены изменения статуса, статусы, которым нужен человек: на проверке, заблокирована, готово.",
"key_updates": "Только ключевые",
"all": "Все события"
},
diff --git a/packages/views/locales/zh-Hans/issues.json b/packages/views/locales/zh-Hans/issues.json
index 14ed839785..fc2d6455d6 100644
--- a/packages/views/locales/zh-Hans/issues.json
+++ b/packages/views/locales/zh-Hans/issues.json
@@ -550,9 +550,9 @@
"subscribe": "订阅",
"unsubscribe": "取消订阅",
"delegated_subscription_badge": "由智能体代你关注",
- "delegated_subscription_hint": "你的智能体代你创建了这个任务,因此你在关注它。待评审、完成或受阻时会通知你。",
+ "delegated_subscription_hint": "你的智能体代你创建了这个任务,因此你在关注它。打开状态变更后,待评审、完成或受阻时会通知你。",
"key_updates_subscription_badge": "仅关键更新",
- "key_updates_subscription_hint": "这是别人负责的任务,你是因为创建、评论或被 @ 才订阅的。只有 @你、回复你参与的讨论,以及待评审、受阻、完成时会通知你。",
+ "key_updates_subscription_hint": "这是别人负责的任务,你是因为创建、评论或被 @ 才订阅的。只有 @你、回复你参与的讨论,以及(打开状态变更时)待评审、受阻、完成时会通知你。",
"key_updates_follow_all": "接收全部动态",
"key_updates_follow_all_done": "之后会收到这个任务的全部动态",
"key_updates_settings": "修改默认设置",
diff --git a/packages/views/locales/zh-Hans/settings.json b/packages/views/locales/zh-Hans/settings.json
index c9e5b5de40..f49198f3d5 100644
--- a/packages/views/locales/zh-Hans/settings.json
+++ b/packages/views/locales/zh-Hans/settings.json
@@ -841,7 +841,7 @@
},
"others_issues": {
"label": "别人的任务",
- "description": "任务分配给别人或别人的智能体,而你只是因为创建、评论或被 @ 自动订阅了它。关键更新指 @你、回复你参与的讨论,以及待评审、受阻、完成等需要人来看的状态。",
+ "description": "任务分配给别人或别人的智能体,而你只是因为创建、评论或被 @ 自动订阅了它。关键更新指 @你、回复你参与的讨论,以及(打开状态变更时)待评审、受阻、完成等需要人来看的状态。",
"key_updates": "仅关键更新",
"all": "全部动态"
},
diff --git a/packages/views/locales/zh-Hant/issues.json b/packages/views/locales/zh-Hant/issues.json
index 221e72d7f7..3c06b7fb00 100644
--- a/packages/views/locales/zh-Hant/issues.json
+++ b/packages/views/locales/zh-Hant/issues.json
@@ -550,9 +550,9 @@
"subscribe": "訂閱",
"unsubscribe": "取消訂閱",
"delegated_subscription_badge": "由 AI 代理代你關注",
- "delegated_subscription_hint": "你的 AI 代理代你建立了這個任務,因此你在關注它。待評審、完成或受阻時會通知你。",
+ "delegated_subscription_hint": "你的 AI 代理代你建立了這個任務,因此你在關注它。開啟狀態變更後,待評審、完成或受阻時會通知你。",
"key_updates_subscription_badge": "僅關鍵更新",
- "key_updates_subscription_hint": "這是別人負責的任務,你是因為建立、留言或被 @ 才訂閱的。只有 @你、回覆你參與的討論,以及待評審、受阻、完成時會通知你。",
+ "key_updates_subscription_hint": "這是別人負責的任務,你是因為建立、留言或被 @ 才訂閱的。只有 @你、回覆你參與的討論,以及(開啟狀態變更時)待評審、受阻、完成時會通知你。",
"key_updates_follow_all": "接收全部動態",
"key_updates_follow_all_done": "之後會收到這個任務的全部動態",
"key_updates_settings": "修改預設設定",
diff --git a/packages/views/locales/zh-Hant/settings.json b/packages/views/locales/zh-Hant/settings.json
index 519a7906ee..65fcf68edc 100644
--- a/packages/views/locales/zh-Hant/settings.json
+++ b/packages/views/locales/zh-Hant/settings.json
@@ -841,7 +841,7 @@
},
"others_issues": {
"label": "別人的任務",
- "description": "任務指派給別人或別人的 AI 代理,而你只是因為建立、留言或被 @ 自動訂閱了它。關鍵更新指 @你、回覆你參與的討論,以及待評審、受阻、完成等需要人來看的狀態。",
+ "description": "任務指派給別人或別人的 AI 代理,而你只是因為建立、留言或被 @ 自動訂閱了它。關鍵更新指 @你、回覆你參與的討論,以及(開啟狀態變更時)待評審、受阻、完成等需要人來看的狀態。",
"key_updates": "僅關鍵更新",
"all": "全部動態"
},
diff --git a/packages/views/settings/components/notifications-tab.test.tsx b/packages/views/settings/components/notifications-tab.test.tsx
index 23fcdd8f41..e307691544 100644
--- a/packages/views/settings/components/notifications-tab.test.tsx
+++ b/packages/views/settings/components/notifications-tab.test.tsx
@@ -1,6 +1,7 @@
import type { ReactNode } from "react";
import { afterEach, describe, expect, it, vi } from "vitest";
import { cleanup, render, screen, within } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { I18nProvider } from "@multica/core/i18n/react";
import { notificationPreferenceKeys } from "@multica/core/notification-preferences/queries";
@@ -19,12 +20,16 @@ vi.mock("../../navigation", () => ({
</a>
),
}));
+const { mutate } = vi.hoisted(() => ({ mutate: vi.fn() }));
vi.mock("@multica/core/notification-preferences/mutations", () => ({
- useUpdateNotificationPreferences: () => ({ mutate: vi.fn() }),
+ useUpdateNotificationPreferences: () => ({ mutate }),
}));
vi.mock("./browser-notification-setting", () => ({ BrowserNotificationSetting: () => null }));
-afterEach(cleanup);
+afterEach(() => {
+ cleanup();
+ mutate.mockReset();
+});
function renderTab(preferences: Record<string, string> = {}) {
const qc = new QueryClient({ defaultOptions: { queries: { staleTime: Infinity } } });
@@ -66,6 +71,24 @@ describe("Inbox notification settings", () => {
expect(within(inbox).getByRole("switch", { name: "Comments" })).toBeChecked();
});
+ it("leaves status changes off until you turn them on", async () => {
+ const user = userEvent.setup();
+ renderTab();
+ const statusChanges = within(screen.getByRole("region", { name: "Inbox" })).getByRole("switch", {
+ name: "Status changes",
+ });
+ expect(statusChanges).not.toBeChecked();
+
+ await user.click(statusChanges);
+ expect(mutate).toHaveBeenCalledWith({ status_changes: "all" }, expect.anything());
+ });
+
+ it("shows status changes on once you turned them on", () => {
+ renderTab({ status_changes: "all" });
+ const inbox = screen.getByRole("region", { name: "Inbox" });
+ expect(within(inbox).getByRole("switch", { name: "Status changes" })).toBeChecked();
+ });
+
it.each<{ preferences: Record<string, string>; shown: string }>([
{ preferences: {}, shown: "Key updates only" },
{ preferences: { others_issues: "key_updates" }, shown: "Key updates only" },
diff --git a/packages/views/settings/components/notifications-tab.tsx b/packages/views/settings/components/notifications-tab.tsx
index 278edc4dae..8784aaf985 100644
--- a/packages/views/settings/components/notifications-tab.tsx
+++ b/packages/views/settings/components/notifications-tab.tsx
@@ -64,15 +64,7 @@ export function NotificationsTab() {
};
const handleToggle = (key: NotificationGroupKey, enabled: boolean) => {
- const updated: NotificationPreferences = {
- ...preferences,
- [key]: enabled ? "all" : "muted",
- };
- // Remove keys set to "all" (default) to keep the object clean
- if (enabled) {
- delete updated[key];
- }
- save(updated);
+ save({ ...preferences, [key]: enabled ? "all" : "muted" });
};
const handleOthersIssues = (value: OthersIssuesValue) => {
@@ -142,7 +134,7 @@ export function NotificationsTab() {
description={t(($) => $.notifications.groups[key].description)}
>
<Switch
- checked={preferences[key] !== "muted"}
+ checked={notificationPreferenceValue(preferences, key) !== "muted"}
aria-label={t(($) => $.notifications.groups[key].label)}
onCheckedChange={(checked) => handleToggle(key, checked)}
/>
diff --git a/server/cmd/server/bystander_tier_test.go b/server/cmd/server/bystander_tier_test.go
index dc4a37f992..799d613f3c 100644
--- a/server/cmd/server/bystander_tier_test.go
+++ b/server/cmd/server/bystander_tier_test.go
@@ -1,7 +1,6 @@
package main
import (
- "context"
"testing"
"github.com/multica-ai/multica/server/internal/events"
@@ -38,16 +37,7 @@ func TestDeliverToBystander(t *testing.T) {
func setOthersIssuesPref(t *testing.T, userID, value string) {
t.Helper()
- workspaceFixture(t).Exec(t, `
- INSERT INTO notification_preference (workspace_id, user_id, preferences)
- VALUES ($1, $2, jsonb_build_object('others_issues', $3::text))
- ON CONFLICT (workspace_id, user_id) DO UPDATE SET preferences = EXCLUDED.preferences
- `, testWorkspaceID, userID, value)
- t.Cleanup(func() {
- testPool.Exec(context.Background(),
- `DELETE FROM notification_preference WHERE workspace_id = $1 AND user_id = $2`,
- testWorkspaceID, userID)
- })
+ setNotificationPref(t, userID, "others_issues", value)
}
func inboxCount(t *testing.T, queries *db.Queries, recipientID string) int {
@@ -71,6 +61,7 @@ func TestBystanderTier_StatusChange(t *testing.T) {
optedIn := createNotificationMember(t, "[email protected]")
t.Cleanup(func() { cleanupTestUser(t, "[email protected]") })
setOthersIssuesPref(t, optedIn, "all")
+ enableStatusChanges(t, owner, watcher, follower, optedIn)
issueID := workspaceFixture(t).Issue(t, "bystander tier issue", testutil.Cols{
"assignee_type": "member",
@@ -114,6 +105,7 @@ func TestBystanderTier_OwnAgentIsOwnIssue(t *testing.T) {
t.Cleanup(func() { cleanupTestUser(t, "[email protected]") })
other := createNotificationMember(t, "[email protected]")
t.Cleanup(func() { cleanupTestUser(t, "[email protected]") })
+ enableStatusChanges(t, owner, other)
f := workspaceFixture(t)
runtimeID := f.Runtime(t, "bystander-runtime", testutil.Cols{"owner_id": owner})
@@ -204,6 +196,7 @@ func TestBystanderTier_ProjectWatcherKeepsEveryEvent(t *testing.T) {
t.Cleanup(func() { cleanupTestUser(t, "[email protected]") })
bystander := createNotificationMember(t, "[email protected]")
t.Cleanup(func() { cleanupTestUser(t, "[email protected]") })
+ enableStatusChanges(t, watcher, bystander)
projectID := createTestProject(t)
f := workspaceFixture(t)
diff --git a/server/cmd/server/delegated_subscriber_test.go b/server/cmd/server/delegated_subscriber_test.go
index 8e6bc546d0..3a8a504aba 100644
--- a/server/cmd/server/delegated_subscriber_test.go
+++ b/server/cmd/server/delegated_subscriber_test.go
@@ -575,6 +575,7 @@ func TestDelegatedTier_ChildCompletionDeliversExactlyOnce(t *testing.T) {
bus := events.New()
agentID, runtimeID := firstFixtureAgent(t)
+ enableStatusChanges(t, testUserID)
parentID := createTestIssue(t, testWorkspaceID, testUserID)
t.Cleanup(func() { cleanupTestIssue(t, parentID) })
diff --git a/server/cmd/server/notification_listeners.go b/server/cmd/server/notification_listeners.go
index 66cc0a88d0..2b4f758adf 100644
--- a/server/cmd/server/notification_listeners.go
+++ b/server/cmd/server/notification_listeners.go
@@ -56,7 +56,9 @@ var parentBubbleNotifTypes = map[string]bool{
// comment lands on the row a handoff would light anyway.
//
// An agent that cannot proceed reaches the human as a blocked status change,
-// which the handoff rule in deliverDelegated already delivers.
+// which the handoff rule in deliverDelegated delivers to a member who turned
+// status changes on, and as the comment explaining the blocker, which always
+// arrives.
var delegatedAlwaysNotifTypes = map[string]bool{
"mentioned": true,
"new_comment": true,
diff --git a/server/cmd/server/notification_listeners_test.go b/server/cmd/server/notification_listeners_test.go
index 244b5bb454..67758b9431 100644
--- a/server/cmd/server/notification_listeners_test.go
+++ b/server/cmd/server/notification_listeners_test.go
@@ -25,6 +25,32 @@ func createNotificationMember(t *testing.T, email string) string {
return id
}
+// setNotificationPref merges one preference into a member's stored row and
+// deletes the row when the test ends.
+func setNotificationPref(t *testing.T, userID, key, value string) {
+ t.Helper()
+ workspaceFixture(t).Exec(t, `
+ INSERT INTO notification_preference (workspace_id, user_id, preferences)
+ VALUES ($1, $2, jsonb_build_object($3::text, $4::text))
+ ON CONFLICT (workspace_id, user_id) DO UPDATE
+ SET preferences = notification_preference.preferences || EXCLUDED.preferences
+ `, testWorkspaceID, userID, key, value)
+ t.Cleanup(func() {
+ testPool.Exec(context.Background(),
+ `DELETE FROM notification_preference WHERE workspace_id = $1 AND user_id = $2`,
+ testWorkspaceID, userID)
+ })
+}
+
+// enableStatusChanges turns on status change notifications, which are muted
+// by default, for tests about where a status change is routed.
+func enableStatusChanges(t *testing.T, userIDs ...string) {
+ t.Helper()
+ for _, id := range userIDs {
+ setNotificationPref(t, id, "status_changes", "all")
+ }
+}
+
// inboxItemsForRecipient returns all non-archived inbox items for a given recipient.
func inboxItemsForRecipient(t *testing.T, queries *db.Queries, recipientID string) []db.ListInboxItemsRow {
t.Helper()
@@ -261,6 +287,7 @@ func TestNotification_StatusChanged(t *testing.T) {
sub2Email := "[email protected]"
sub2ID := createNotificationMember(t, sub2Email)
t.Cleanup(func() { cleanupTestUser(t, sub2Email) })
+ enableStatusChanges(t, sub1ID, sub2ID)
issueID := createTestIssue(t, testWorkspaceID, testUserID)
t.Cleanup(func() {
@@ -327,19 +354,32 @@ func TestNotification_StatusChanged(t *testing.T) {
}
}
-// TestNotification_StatusChanged_Muted verifies that status_changes="muted"
-// prevents a new Inbox row without affecting other subscribers.
+// TestNotification_StatusChanged_Muted verifies that status changes are muted
+// by default (MUL-9449): only a member who turned them on gets a row, and an
+// explicit "muted" still drops it.
func TestNotification_StatusChanged_Muted(t *testing.T) {
queries := db.New(testPool)
bus := newNotificationBus(t, queries)
+ defaultEmail := "[email protected]"
+ defaultID := createNotificationMember(t, defaultEmail)
+ t.Cleanup(func() { cleanupTestUser(t, defaultEmail) })
+
mutedEmail := "[email protected]"
mutedID := createNotificationMember(t, mutedEmail)
t.Cleanup(func() { cleanupTestUser(t, mutedEmail) })
+ setNotificationPref(t, mutedID, "status_changes", "muted")
- normalEmail := "[email protected]"
- normalID := createNotificationMember(t, normalEmail)
- t.Cleanup(func() { cleanupTestUser(t, normalEmail) })
+ // A stored row without the key still applies the default.
+ otherPrefEmail := "[email protected]"
+ otherPrefID := createNotificationMember(t, otherPrefEmail)
+ t.Cleanup(func() { cleanupTestUser(t, otherPrefEmail) })
+ setNotificationPref(t, otherPrefID, "comments", "muted")
+
+ optedInEmail := "[email protected]"
+ optedInID := createNotificationMember(t, optedInEmail)
+ t.Cleanup(func() { cleanupTestUser(t, optedInEmail) })
+ enableStatusChanges(t, optedInID)
issueID := createTestIssue(t, testWorkspaceID, testUserID)
t.Cleanup(func() {
@@ -347,42 +387,24 @@ func TestNotification_StatusChanged_Muted(t *testing.T) {
cleanupTestIssue(t, issueID)
})
- if _, err := testPool.Exec(context.Background(), `
- INSERT INTO notification_preference (workspace_id, user_id, preferences)
- VALUES ($1, $2, '{"status_changes":"muted"}'::jsonb)
- `, testWorkspaceID, mutedID); err != nil {
- t.Fatalf("seed muted notification preference: %v", err)
+ for _, id := range []string{defaultID, mutedID, otherPrefID, optedInID} {
+ addTestSubscriber(t, issueID, "member", id, "commenter")
}
- addTestSubscriber(t, issueID, "member", mutedID, "commenter")
- addTestSubscriber(t, issueID, "member", normalID, "commenter")
-
- bus.Publish(events.Event{
- Type: protocol.EventIssueUpdated,
- WorkspaceID: testWorkspaceID,
- ActorType: "member",
- ActorID: testUserID,
- Payload: map[string]any{
- "issue": handler.IssueResponse{
- ID: issueID,
- WorkspaceID: testWorkspaceID,
- Title: "muted status test issue",
- Status: "in_progress",
- Priority: "medium",
- CreatorType: "member",
- CreatorID: testUserID,
- },
- "assignee_changed": false,
- "status_changed": true,
- "prev_status": "todo",
- },
- })
+ publishStatusChange(bus, issueID, "in_progress", "todo")
- if items := inboxItemsForRecipient(t, queries, mutedID); len(items) != 0 {
- t.Fatalf("expected muted subscriber to receive 0 items, got %d", len(items))
- }
- if items := inboxItemsForRecipient(t, queries, normalID); len(items) != 1 {
- t.Fatalf("expected normal subscriber to receive 1 item, got %d", len(items))
+ for name, c := range map[string]struct {
+ id string
+ want int
+ }{
+ "default": {defaultID, 0},
+ "muted": {mutedID, 0},
+ "other pref only": {otherPrefID, 0},
+ "opted in": {optedInID, 1},
+ } {
+ if got := len(inboxItemsForRecipient(t, queries, c.id)); got != c.want {
+ t.Errorf("%s subscriber: %d inbox items, want %d", name, got, c.want)
+ }
}
}
@@ -1074,6 +1096,7 @@ func TestNotification_ParentBubble_StatusChanged(t *testing.T) {
parentSubEmail := "[email protected]"
parentSubID := createNotificationMember(t, parentSubEmail)
t.Cleanup(func() { cleanupTestUser(t, parentSubEmail) })
+ enableStatusChanges(t, parentSubID)
parentID := createTestIssue(t, testWorkspaceID, testUserID)
t.Cleanup(func() {
@@ -1421,6 +1444,7 @@ func TestNotification_StatusChange_DoneArchivesIssueInbox(t *testing.T) {
subEmail := "[email protected]"
subID := createNotificationMember(t, subEmail)
t.Cleanup(func() { cleanupTestUser(t, subEmail) })
+ enableStatusChanges(t, subID)
issueID := createTestIssue(t, testWorkspaceID, testUserID)
t.Cleanup(func() {
diff --git a/server/cmd/server/notification_membership_test.go b/server/cmd/server/notification_membership_test.go
index 9c602b5da2..6037da7a0f 100644
--- a/server/cmd/server/notification_membership_test.go
+++ b/server/cmd/server/notification_membership_test.go
@@ -130,6 +130,7 @@ func TestNotification_CurrentMembership(t *testing.T) {
fx.Cleanup(t, `DELETE FROM issue_subscriber WHERE issue_id = $1`, subscriberIssue)
}
addTestSubscriber(t, subscriberIssue, "member", recipient, "manual")
+ enableStatusChanges(t, recipient)
e.Type = protocol.EventIssueUpdated
issue.Status = "done"
payload["issue"], payload["status_changed"], payload["prev_status"] = issue, true, "todo"
diff --git a/server/cmd/server/notification_project_subscriber_test.go b/server/cmd/server/notification_project_subscriber_test.go
index fd05663c46..fd7451c7a3 100644
--- a/server/cmd/server/notification_project_subscriber_test.go
+++ b/server/cmd/server/notification_project_subscriber_test.go
@@ -129,6 +129,7 @@ func TestNotification_ProjectSubscriber_IssueEvents(t *testing.T) {
bothEmail := "[email protected]"
bothID := createNotificationMember(t, bothEmail)
t.Cleanup(func() { cleanupTestUser(t, bothEmail) })
+ enableStatusChanges(t, watcherID, bothID)
projectID := createTestProject(t)
issueID := createProjectIssue(t, projectID)
diff --git a/server/cmd/server/subscription_delivery_test.go b/server/cmd/server/subscription_delivery_test.go
index 6d7f2d7994..6f976edc0f 100644
--- a/server/cmd/server/subscription_delivery_test.go
+++ b/server/cmd/server/subscription_delivery_test.go
@@ -32,6 +32,8 @@ func TestSubscriberDeliveryMatchesFanout(t *testing.T) {
delegate := member("[email protected]")
optedIn := member("[email protected]")
setOthersIssuesPref(t, optedIn, "all")
+ // Status changes are muted by default; this test is about the tiers.
+ enableStatusChanges(t, owner, bystander, follower, projectWatcher, delegate, optedIn)
projectID := createTestProject(t)
f := workspaceFixture(t)
diff --git a/server/internal/handler/inbox_snooze_test.go b/server/internal/handler/inbox_snooze_test.go
index 989ce64f9f..feca9fea0f 100644
--- a/server/internal/handler/inbox_snooze_test.go
+++ b/server/internal/handler/inbox_snooze_test.go
@@ -184,7 +184,7 @@ func TestInboxRowsWrittenIntoASnoozeJoinItUnlessTheyWakeIt(t *testing.T) {
IssueID: parseUUID(f.issueID),
Title: "Snoozed issue",
Details: []byte(details),
- }})
+ }, IgnorePreferences: true}) // About snoozes, not preferences: status changes start muted.
if err != nil || !inserted {
t.Fatalf("create %s: inserted=%v err=%v", notifType, inserted, err)
}
diff --git a/server/internal/handler/notification_preference.go b/server/internal/handler/notification_preference.go
index 9a06df75b3..edf3e20777 100644
--- a/server/internal/handler/notification_preference.go
+++ b/server/internal/handler/notification_preference.go
@@ -7,6 +7,7 @@ import (
"net/http"
"github.com/jackc/pgx/v5"
+ "github.com/multica-ai/multica/server/internal/inbox"
"github.com/multica-ai/multica/server/internal/logger"
db "github.com/multica-ai/multica/server/pkg/db/generated"
)
@@ -70,7 +71,7 @@ func (h *Handler) GetNotificationPreferences(w http.ResponseWriter, r *http.Requ
if errors.Is(err, pgx.ErrNoRows) {
writeJSON(w, http.StatusOK, map[string]any{
"workspace_id": workspaceID,
- "preferences": map[string]any{},
+ "preferences": inbox.WithDefaults(nil),
})
return
}
@@ -78,23 +79,16 @@ func (h *Handler) GetNotificationPreferences(w http.ResponseWriter, r *http.Requ
writeError(w, http.StatusInternalServerError, "failed to get notification preferences")
return
}
-
- var prefs map[string]string
- if err := json.Unmarshal(pref.Preferences, &prefs); err != nil {
- prefs = map[string]string{}
- }
-
- writeJSON(w, http.StatusOK, map[string]any{
- "workspace_id": workspaceID,
- "preferences": prefs,
- })
+ writeNotificationPreferenceResponse(w, workspaceID, pref)
}
type updateNotifPrefRequest struct {
Preferences map[string]string `json:"preferences"`
}
-func decodeNotificationPreferenceRequest(w http.ResponseWriter, r *http.Request) ([]byte, bool) {
+// decodeNotificationPreferenceRequest reads and validates the preferences in
+// a write request.
+func decodeNotificationPreferenceRequest(w http.ResponseWriter, r *http.Request) (map[string]string, bool) {
var req updateNotifPrefRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
writeError(w, http.StatusBadRequest, "invalid request body")
@@ -117,7 +111,11 @@ func decodeNotificationPreferenceRequest(w http.ResponseWriter, r *http.Request)
}
}
- prefsJSON, err := json.Marshal(req.Preferences)
+ return req.Preferences, true
+}
+
+func marshalNotificationPreferences(w http.ResponseWriter, prefs map[string]string) ([]byte, bool) {
+ prefsJSON, err := json.Marshal(prefs)
if err != nil {
writeError(w, http.StatusInternalServerError, "failed to marshal preferences")
return nil, false
@@ -125,6 +123,9 @@ func decodeNotificationPreferenceRequest(w http.ResponseWriter, r *http.Request)
return prefsJSON, true
}
+// writeNotificationPreferenceResponse answers with the stored preferences plus
+// the groups muted by default (inbox.WithDefaults), so every client renders
+// those switches as off whichever defaults it was built with.
func writeNotificationPreferenceResponse(
w http.ResponseWriter,
workspaceID string,
@@ -137,7 +138,7 @@ func writeNotificationPreferenceResponse(
writeJSON(w, http.StatusOK, map[string]any{
"workspace_id": workspaceID,
- "preferences": prefs,
+ "preferences": inbox.WithDefaults(prefs),
})
}
@@ -149,7 +150,13 @@ func (h *Handler) UpdateNotificationPreferences(w http.ResponseWriter, r *http.R
return
}
workspaceID := ctxWorkspaceID(r.Context())
- prefsJSON, ok := decodeNotificationPreferenceRequest(w, r)
+ prefs, ok := decodeNotificationPreferenceRequest(w, r)
+ if !ok {
+ return
+ }
+ // Only clients built before PATCH existed send this full replacement, and
+ // they leave a group out to mean "on".
+ prefsJSON, ok := marshalNotificationPreferences(w, inbox.WithLegacyDefaults(prefs))
if !ok {
return
}
@@ -175,7 +182,11 @@ func (h *Handler) PatchNotificationPreferences(w http.ResponseWriter, r *http.Re
return
}
workspaceID := ctxWorkspaceID(r.Context())
- prefsJSON, ok := decodeNotificationPreferenceRequest(w, r)
+ prefs, ok := decodeNotificationPreferenceRequest(w, r)
+ if !ok {
+ return
+ }
+ prefsJSON, ok := marshalNotificationPreferences(w, prefs)
if !ok {
return
}
diff --git a/server/internal/handler/notification_preference_test.go b/server/internal/handler/notification_preference_test.go
index c38f611521..f97cb2fa2c 100644
--- a/server/internal/handler/notification_preference_test.go
+++ b/server/internal/handler/notification_preference_test.go
@@ -8,7 +8,9 @@ import (
"strings"
"testing"
+ "github.com/multica-ai/multica/server/internal/inbox"
"github.com/multica-ai/multica/server/internal/middleware"
+ "github.com/multica-ai/multica/server/internal/testutil"
db "github.com/multica-ai/multica/server/pkg/db/generated"
)
@@ -61,7 +63,7 @@ func TestPatchNotificationPreferencesMergesWithoutReplacing(t *testing.T) {
testHandler.UpdateNotificationPreferences(
putRecorder,
notificationPreferenceRequest(t, http.MethodPut, map[string]string{
- "status_changes": "muted",
+ "updates": "muted",
}),
)
if putRecorder.Code != http.StatusOK {
@@ -90,8 +92,8 @@ func TestPatchNotificationPreferencesMergesWithoutReplacing(t *testing.T) {
if response.WorkspaceID != testWorkspaceID {
t.Fatalf("workspace_id = %q, want %q", response.WorkspaceID, testWorkspaceID)
}
- if response.Preferences["status_changes"] != "muted" {
- t.Fatalf("status_changes was replaced: %#v", response.Preferences)
+ if response.Preferences["updates"] != "muted" {
+ t.Fatalf("updates was replaced: %#v", response.Preferences)
}
if response.Preferences["comments"] != "muted" {
t.Fatalf("comments patch missing: %#v", response.Preferences)
@@ -123,11 +125,169 @@ func TestPatchNotificationPreferencesMergesWithoutReplacing(t *testing.T) {
if err := json.Unmarshal(persisted, &preferences); err != nil {
t.Fatalf("decode persisted preference: %v", err)
}
- if preferences["status_changes"] != "all" || preferences["comments"] != "muted" {
+ if preferences["status_changes"] != "all" || preferences["comments"] != "muted" || preferences["updates"] != "muted" {
t.Fatalf("unexpected persisted preferences: %#v", preferences)
}
}
+// Status changes are muted by default (MUL-9449). Responses say so explicitly,
+// because installed clients read a missing key as "all" and would show the
+// switch on; storage stays sparse.
+func TestNotificationPreferencesReportStatusChangesMutedByDefault(t *testing.T) {
+ if testHandler == nil || testPool == nil {
+ t.Skip("database not available")
+ }
+
+ ctx := context.Background()
+ reset := func() {
+ _, _ = testPool.Exec(ctx, `
+ DELETE FROM notification_preference
+ WHERE workspace_id = $1 AND user_id = $2
+ `, testWorkspaceID, testUserID)
+ }
+ reset()
+ t.Cleanup(reset)
+
+ call := func(method string, prefs map[string]string) map[string]string {
+ t.Helper()
+ recorder := httptest.NewRecorder()
+ switch method {
+ case http.MethodGet:
+ testHandler.GetNotificationPreferences(recorder, notificationPreferenceRequest(t, method, nil))
+ case http.MethodPatch:
+ testHandler.PatchNotificationPreferences(recorder, notificationPreferenceRequest(t, method, prefs))
+ }
+ if recorder.Code != http.StatusOK {
+ t.Fatalf("%s: status=%d body=%s", method, recorder.Code, recorder.Body.String())
+ }
+ var response struct {
+ Preferences map[string]string `json:"preferences"`
+ }
+ if err := json.NewDecoder(recorder.Body).Decode(&response); err != nil {
+ t.Fatalf("%s: decode response: %v", method, err)
+ }
+ return response.Preferences
+ }
+
+ if got := call(http.MethodGet, nil); len(got) != 1 || got["status_changes"] != "muted" {
+ t.Fatalf("GET without a row = %#v, want status_changes muted", got)
+ }
+
+ if got := call(http.MethodPatch, map[string]string{"comments": "muted"}); got["status_changes"] != "muted" || got["comments"] != "muted" {
+ t.Fatalf("PATCH comments = %#v, want comments and the default status_changes muted", got)
+ }
+ var stored map[string]string
+ var raw []byte
+ if err := testPool.QueryRow(ctx, `
+ SELECT preferences FROM notification_preference
+ WHERE workspace_id = $1 AND user_id = $2
+ `, testWorkspaceID, testUserID).Scan(&raw); err != nil {
+ t.Fatalf("load persisted preference: %v", err)
+ }
+ if err := json.Unmarshal(raw, &stored); err != nil {
+ t.Fatalf("decode persisted preference: %v", err)
+ }
+ if _, ok := stored["status_changes"]; ok {
+ t.Fatalf("the default was persisted: %#v", stored)
+ }
+
+ call(http.MethodPatch, map[string]string{"status_changes": "all"})
+ if got := call(http.MethodGet, nil); got["status_changes"] != "all" || got["comments"] != "muted" {
+ t.Fatalf("GET after turning status changes on = %#v", got)
+ }
+}
+
+// A client built before PATCH (MUL-4798) replaces the whole object and leaves
+// a group out to mean "on". Its status changes stay on through persistence,
+// read-back and delivery, while an explicit "muted" still turns them off
+// (MUL-9449).
+func TestLegacyPutKeepsOmittedStatusChangesOn(t *testing.T) {
+ if testHandler == nil || testPool == nil {
+ t.Skip("database not available")
+ }
+
+ ctx := context.Background()
+ reset := func() {
+ _, _ = testPool.Exec(ctx, `
+ DELETE FROM notification_preference
+ WHERE workspace_id = $1 AND user_id = $2
+ `, testWorkspaceID, testUserID)
+ }
+ t.Cleanup(reset)
+
+ for _, tc := range []struct {
+ name string
+ sent map[string]string
+ stored string
+ delivered bool
+ }{
+ {"nothing muted", map[string]string{}, "all", true},
+ {"another group muted", map[string]string{"comments": "muted"}, "all", true},
+ {"status changes muted", map[string]string{"status_changes": "muted"}, "muted", false},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ reset()
+
+ recorder := httptest.NewRecorder()
+ testHandler.UpdateNotificationPreferences(recorder, notificationPreferenceRequest(t, http.MethodPut, tc.sent))
+ if recorder.Code != http.StatusOK {
+ t.Fatalf("PUT: status=%d body=%s", recorder.Code, recorder.Body.String())
+ }
+
+ var raw []byte
+ if err := testPool.QueryRow(ctx, `
+ SELECT preferences FROM notification_preference
+ WHERE workspace_id = $1 AND user_id = $2
+ `, testWorkspaceID, testUserID).Scan(&raw); err != nil {
+ t.Fatalf("load persisted preference: %v", err)
+ }
+ var stored map[string]string
+ if err := json.Unmarshal(raw, &stored); err != nil {
+ t.Fatalf("decode persisted preference: %v", err)
+ }
+ if stored["status_changes"] != tc.stored {
+ t.Fatalf("persisted %#v, want status_changes %q", stored, tc.stored)
+ }
+ for group, value := range tc.sent {
+ if stored[group] != value {
+ t.Fatalf("persisted %#v, want the sent %s=%q kept", stored, group, value)
+ }
+ }
+
+ get := httptest.NewRecorder()
+ testHandler.GetNotificationPreferences(get, notificationPreferenceRequest(t, http.MethodGet, nil))
+ var response struct {
+ Preferences map[string]string `json:"preferences"`
+ }
+ if err := json.NewDecoder(get.Body).Decode(&response); err != nil {
+ t.Fatalf("decode GET response: %v", err)
+ }
+ if response.Preferences["status_changes"] != tc.stored {
+ t.Fatalf("GET = %#v, want status_changes %q", response.Preferences, tc.stored)
+ }
+
+ issueID := dbfx.Issue(t, "Legacy PUT status change", testutil.Cols{"workspace_id": testWorkspaceID})
+ dbfx.Cleanup(t, `DELETE FROM inbox_item WHERE issue_id = $1`, issueID)
+ _, inserted, err := inbox.Deliver(ctx, testHandler.Queries, nil, inbox.Notification{Params: db.CreateInboxItemParams{
+ WorkspaceID: parseUUID(testWorkspaceID),
+ RecipientType: "member",
+ RecipientID: parseUUID(testUserID),
+ Type: "status_changed",
+ Severity: "info",
+ IssueID: parseUUID(issueID),
+ Title: "Legacy PUT status change",
+ Details: []byte(`{}`),
+ }})
+ if err != nil {
+ t.Fatalf("deliver status_changed: %v", err)
+ }
+ if inserted != tc.delivered {
+ t.Fatalf("status_changed delivered = %v, want %v", inserted, tc.delivered)
+ }
+ })
+ }
+}
+
// TestPatchNotificationPreferencesAcceptsAddedGroups covers groups added after
// the original set: mentions (#6468), reactions (MUL-9328) and
// auto_archive_completed (MUL-9336). The whitelist rejects unknown keys, so a
diff --git a/server/internal/inbox/deliver.go b/server/internal/inbox/deliver.go
index 740afb8c3f..0dacf978c6 100644
--- a/server/internal/inbox/deliver.go
+++ b/server/internal/inbox/deliver.go
@@ -50,7 +50,7 @@ func Deliver(ctx context.Context, queries *db.Queries, pub Publisher, n Notifica
if prefs == nil {
prefs = LoadPreferences(ctx, queries, n.Params.WorkspaceID, []pgtype.UUID{n.Params.RecipientID})
}
- if p, ok := prefs[util.UUIDToString(n.Params.RecipientID)]; ok && Muted(p, n.Params.Type) {
+ if Muted(prefs[util.UUIDToString(n.Params.RecipientID)], n.Params.Type) {
return db.InboxItem{}, false, nil
}
}
diff --git a/server/internal/inbox/registry.go b/server/internal/inbox/registry.go
index 170c05f5a7..2d8f0b22d9 100644
--- a/server/internal/inbox/registry.go
+++ b/server/internal/inbox/registry.go
@@ -89,14 +89,59 @@ func Group(notifType string) (group string, ok bool) {
return group, ok
}
-// Muted reports whether a member's parsed preferences mute notifType. A
-// missing key means the default "all": preferences are stored sparse.
+// mutedByDefault are the groups a member hears nothing from until they turn
+// them on. Every other group defaults to "all". Preferences are stored sparse,
+// so a missing key means its group's default.
+//
+// Status changes are routine churn on most issues, so they start muted
+// (MUL-9449). An explicit "all" is how a member opts back in.
+var mutedByDefault = map[string]bool{
+ GroupStatusChanges: true,
+}
+
+// WithLegacyDefaults returns prefs with every group that is muted by default
+// and absent from prefs set to "all". A full replacement from a client built
+// before those defaults changed omits a group to mean "on", so the
+// replace-all write path stores that meaning explicitly. prefs is not
+// modified.
+func WithLegacyDefaults(prefs map[string]string) map[string]string {
+ result := make(map[string]string, len(prefs)+len(mutedByDefault))
+ for group := range mutedByDefault {
+ result[group] = "all"
+ }
+ for k, v := range prefs {
+ result[k] = v
+ }
+ return result
+}
+
+// Muted reports whether a member's parsed preferences mute notifType. nil
+// prefs, a member without a stored row, applies every group's default.
func Muted(prefs map[string]string, notifType string) bool {
group := typeGroups[notifType]
if group == "" {
return false
}
- return prefs[group] == "muted"
+ value, ok := prefs[group]
+ if !ok {
+ return mutedByDefault[group]
+ }
+ return value == "muted"
+}
+
+// WithDefaults returns prefs with every group that is muted by default
+// written out. The preferences API answers with it so a client built before a
+// group's default changed, which reads a missing key as "all", still shows
+// what the server delivers. prefs is not modified.
+func WithDefaults(prefs map[string]string) map[string]string {
+ result := make(map[string]string, len(prefs)+len(mutedByDefault))
+ for group := range mutedByDefault {
+ result[group] = "muted"
+ }
+ for k, v := range prefs {
+ result[k] = v
+ }
+ return result
}
// Preferences holds the parsed notification preferences of a set of members
@@ -105,8 +150,8 @@ type Preferences map[string]map[string]string
// LoadPreferences reads the preferences of userIDs in one query, for a fanout
// that delivers to many members. A read failure is logged and yields no
-// preferences, so the fanout delivers rather than drops. The result is never
-// nil, which is how Deliver tells "loaded" from "not loaded".
+// preferences, so every recipient gets the defaults. The result is never nil,
+// which is how Deliver tells "loaded" from "not loaded".
func LoadPreferences(ctx context.Context, queries *db.Queries, workspaceID pgtype.UUID, userIDs []pgtype.UUID) Preferences {
result := Preferences{}
if len(userIDs) == 0 {
diff --git a/server/internal/inbox/registry_test.go b/server/internal/inbox/registry_test.go
index 35b64838c0..a957565394 100644
--- a/server/internal/inbox/registry_test.go
+++ b/server/internal/inbox/registry_test.go
@@ -29,7 +29,7 @@ func TestMutedGroupSplit(t *testing.T) {
{"muted mentions still delivers new_comment", map[string]string{"mentions": "muted"}, "new_comment", false},
{"both muted drops both", map[string]string{"comments": "muted", "mentions": "muted"}, "mentioned", true},
- // Absent key means the default "all" — preferences are stored sparse,
+ // Absent key means the group's default — preferences are stored sparse,
// which is why existing `{"comments":"muted"}` rows need no migration.
{"empty prefs delivers mentions", map[string]string{}, "mentioned", false},
{"empty prefs delivers comments", map[string]string{}, "new_comment", false},
@@ -58,6 +58,63 @@ func TestMutedGroupSplit(t *testing.T) {
}
}
+// Status changes start muted: a member without a stored choice, or without a
+// row at all, hears them only after turning them on (MUL-9449).
+func TestStatusChangesMutedByDefault(t *testing.T) {
+ cases := []struct {
+ name string
+ prefs map[string]string
+ want bool
+ }{
+ {"no row", nil, true},
+ {"row without the key", map[string]string{"comments": "muted"}, true},
+ {"turned on", map[string]string{"status_changes": "all"}, false},
+ {"turned off", map[string]string{"status_changes": "muted"}, true},
+ }
+ for _, tc := range cases {
+ t.Run(tc.name, func(t *testing.T) {
+ if got := Muted(tc.prefs, "status_changed"); got != tc.want {
+ t.Fatalf("Muted(%v, status_changed) = %v, want %v", tc.prefs, got, tc.want)
+ }
+ })
+ }
+ if Muted(nil, "new_comment") || Muted(nil, "issue_assigned") {
+ t.Fatal("only status changes are muted by default")
+ }
+}
+
+// The preferences API reports the default-muted groups so a client that
+// predates the default renders their switches off.
+func TestWithDefaults(t *testing.T) {
+ if got := WithDefaults(nil); len(got) != 1 || got["status_changes"] != "muted" {
+ t.Fatalf("WithDefaults(nil) = %v, want only status_changes muted", got)
+ }
+ stored := map[string]string{"status_changes": "all", "comments": "muted"}
+ got := WithDefaults(stored)
+ if got["status_changes"] != "all" || got["comments"] != "muted" || len(got) != 2 {
+ t.Fatalf("WithDefaults(%v) = %v, stored values must win", stored, got)
+ }
+ if len(stored) != 2 {
+ t.Fatalf("WithDefaults modified its argument: %v", stored)
+ }
+}
+
+// The replace-all write path keeps an omitted default-muted group on, as the
+// clients that use it mean, and leaves explicit values alone.
+func TestWithLegacyDefaults(t *testing.T) {
+ if got := WithLegacyDefaults(map[string]string{}); len(got) != 1 || got["status_changes"] != "all" {
+ t.Fatalf("WithLegacyDefaults({}) = %v, want status_changes all", got)
+ }
+ sent := map[string]string{"status_changes": "muted", "comments": "muted"}
+ got := WithLegacyDefaults(sent)
+ if got["status_changes"] != "muted" || got["comments"] != "muted" || len(got) != 2 {
+ t.Fatalf("WithLegacyDefaults(%v) = %v, sent values must win", sent, got)
+ }
+ if len(sent) != 2 {
+ t.Fatalf("WithLegacyDefaults modified its argument: %v", sent)
+ }
+}
+
// App results follow the agent-activity group; the requests that stop an
// agent until the person answers can never be muted.
func TestConnectedAppTypeGroups(t *testing.T) {