Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(shared-task): 共享名额提示改为服务端判定 (#4998)

DavidShenXD36d5ef0b4630
diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.json
index 5768c96419..8cc4376edf 100644
--- a/apps/desktop/src/renderer/i18n/locales/en/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json
@@ -48,8 +48,8 @@
"requestJoin": "Join",
"dismiss": "Close Dialog",
"title": "Share Task",
- "hostLimit": "You can host up to 2 shared tasks at a time. Close one before trying again.",
- "joinLimit": "You can join up to 2 shared tasks at a time. Leave one before trying again.",
+ "hostLimit": "You've reached the current limit for hosted shared tasks. Close shared tasks until you're below the limit, then try again.",
+ "joinLimit": "You've reached the current limit for joined shared tasks. Leave shared tasks until you're below the limit, then try again.",
"guestLimit": "This shared task already has 2 guests. You cannot join it yet.",
"invitationUnavailable": "This invitation is invalid or no longer valid. Ask the host for a new invitation.",
"invitationRenew": "This old invitation cannot be used to rejoin. Ask the host for a new invitation.",
diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.json
index 48c29227a9..18b3e94802 100644
--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json
@@ -48,8 +48,8 @@
"requestJoin": "参加",
"dismiss": "ダイアログを閉じる",
"title": "セッションを共有",
- "hostLimit": "同時に共有できるタスクは 2 件までです。共有を 1 件終了してから再試行してください。",
- "joinLimit": "同時に参加できる共有タスクは 2 件までです。1 件から退出してから再試行してください。",
+ "hostLimit": "共有タスクの開始数が現在の上限に達しました。上限を下回るまで共有タスクを終了してから再試行してください。",
+ "joinLimit": "参加中の共有タスクが現在の上限に達しました。上限を下回るまで共有タスクから退出してから再試行してください。",
"guestLimit": "この共有タスクにはすでにゲストが 2 人いるため、参加できません。",
"invitationUnavailable": "この招待は無効になっています。ホストに新しい招待を依頼してください。",
"invitationRenew": "以前の招待では再参加できません。ホストに新しい招待を依頼してください。",
diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.json
index 50736f445c..16dff5b61b 100644
--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json
@@ -48,8 +48,8 @@
"requestJoin": "참여",
"dismiss": "대화 상자 닫기",
"title": "세션 공유",
- "hostLimit": "동시에 공유할 수 있는 작업은 최대 2개입니다. 하나를 닫은 후 다시 시도하세요.",
- "joinLimit": "동시에 참여할 수 있는 공유 작업은 최대 2개입니다. 하나에서 나간 후 다시 시도하세요.",
+ "hostLimit": "공유 중인 작업 수가 현재 한도에 도달했습니다. 한도 미만이 될 때까지 공유 작업을 종료한 후 다시 시도하세요.",
+ "joinLimit": "참여 중인 공유 작업 수가 현재 한도에 도달했습니다. 한도 미만이 될 때까지 공유 작업에서 나간 후 다시 시도하세요.",
"guestLimit": "이 공유 작업에는 이미 게스트가 2명 있어 참여할 수 없습니다.",
"invitationUnavailable": "유효하지 않거나 만료된 초대입니다. 호스트에게 새 초대를 요청하세요.",
"invitationRenew": "이전 초대로는 다시 참여할 수 없습니다. 호스트에게 새 초대를 요청하세요.",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
index c8658e486e..75182e2371 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json
@@ -48,8 +48,8 @@
"requestJoin": "加入",
"dismiss": "关闭窗口",
"title": "共享任务",
- "hostLimit": "你最多同时开启 2 个共享任务,请先关闭一个再试。",
- "joinLimit": "你最多同时加入 2 个共享任务,请先退出一个再试。",
+ "hostLimit": "开启的共享任务已达当前上限,请关闭共享任务,直到数量低于上限后再试。",
+ "joinLimit": "加入的共享任务已达当前上限,请退出共享任务,直到数量低于上限后再试。",
"guestLimit": "此共享任务已有 2 名访客,暂时无法加入。",
"invitationUnavailable": "邀请无效或已失效,请向房主获取新邀请",
"invitationRenew": "旧邀请无法再次加入,请向房主获取新邀请",
diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
index 1fcb17a018..c84fc92c26 100644
--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json
@@ -48,8 +48,8 @@
"requestJoin": "加入",
"dismiss": "關閉視窗",
"title": "共享任務",
- "hostLimit": "你最多同時開啟 2 個共享任務,請先關閉一個再試。",
- "joinLimit": "你最多同時加入 2 個共享任務,請先退出一個再試。",
+ "hostLimit": "開啟的共享任務已達目前上限,請關閉共享任務,直到數量低於上限後再試。",
+ "joinLimit": "加入的共享任務已達目前上限,請退出共享任務,直到數量低於上限後再試。",
"guestLimit": "此共享任務已有 2 名訪客,暫時無法加入。",
"invitationUnavailable": "邀請無效或已失效,請向房主取得新邀請",
"invitationRenew": "舊邀請無法再次加入,請向房主取得新邀請",
diff --git a/apps/mobile/src/i18n/locales/en/sharedTask.json b/apps/mobile/src/i18n/locales/en/sharedTask.json
index 95cf40e31b..17ad5fae5f 100644
--- a/apps/mobile/src/i18n/locales/en/sharedTask.json
+++ b/apps/mobile/src/i18n/locales/en/sharedTask.json
@@ -11,8 +11,8 @@
"requestJoin": "Join",
"dismiss": "Close Dialog",
"title": "Share Task",
- "hostLimit": "You can host up to 2 shared tasks at a time. Close one before trying again.",
- "joinLimit": "You can join up to 2 shared tasks at a time. Leave one before trying again.",
+ "hostLimit": "You've reached the current limit for hosted shared tasks. Close shared tasks until you're below the limit, then try again.",
+ "joinLimit": "You've reached the current limit for joined shared tasks. Leave shared tasks until you're below the limit, then try again.",
"guestLimit": "This shared task already has 2 guests. You cannot join it yet.",
"invitationUnavailable": "This invitation is invalid or no longer valid. Ask the host for a new invitation.",
"invitationRenew": "This old invitation cannot be used to rejoin. Ask the host for a new invitation.",
diff --git a/apps/mobile/src/i18n/locales/ja/sharedTask.json b/apps/mobile/src/i18n/locales/ja/sharedTask.json
index e13bac513c..e2c7bad025 100644
--- a/apps/mobile/src/i18n/locales/ja/sharedTask.json
+++ b/apps/mobile/src/i18n/locales/ja/sharedTask.json
@@ -11,8 +11,8 @@
"requestJoin": "参加",
"dismiss": "ダイアログを閉じる",
"title": "セッションを共有",
- "hostLimit": "同時に共有できるタスクは 2 件までです。共有を 1 件終了してから再試行してください。",
- "joinLimit": "同時に参加できる共有タスクは 2 件までです。1 件から退出してから再試行してください。",
+ "hostLimit": "共有タスクの開始数が現在の上限に達しました。上限を下回るまで共有タスクを終了してから再試行してください。",
+ "joinLimit": "参加中の共有タスクが現在の上限に達しました。上限を下回るまで共有タスクから退出してから再試行してください。",
"guestLimit": "この共有タスクにはすでにゲストが 2 人いるため、参加できません。",
"invitationUnavailable": "この招待は無効になっています。ホストに新しい招待を依頼してください。",
"invitationRenew": "以前の招待では再参加できません。ホストに新しい招待を依頼してください。",
diff --git a/apps/mobile/src/i18n/locales/ko/sharedTask.json b/apps/mobile/src/i18n/locales/ko/sharedTask.json
index 4670ed529a..1260e766a0 100644
--- a/apps/mobile/src/i18n/locales/ko/sharedTask.json
+++ b/apps/mobile/src/i18n/locales/ko/sharedTask.json
@@ -11,8 +11,8 @@
"requestJoin": "참여",
"dismiss": "대화 상자 닫기",
"title": "세션 공유",
- "hostLimit": "동시에 공유할 수 있는 작업은 최대 2개입니다. 하나를 닫은 후 다시 시도하세요.",
- "joinLimit": "동시에 참여할 수 있는 공유 작업은 최대 2개입니다. 하나에서 나간 후 다시 시도하세요.",
+ "hostLimit": "공유 중인 작업 수가 현재 한도에 도달했습니다. 한도 미만이 될 때까지 공유 작업을 종료한 후 다시 시도하세요.",
+ "joinLimit": "참여 중인 공유 작업 수가 현재 한도에 도달했습니다. 한도 미만이 될 때까지 공유 작업에서 나간 후 다시 시도하세요.",
"guestLimit": "이 공유 작업에는 이미 게스트가 2명 있어 참여할 수 없습니다.",
"invitationUnavailable": "유효하지 않거나 만료된 초대입니다. 호스트에게 새 초대를 요청하세요.",
"invitationRenew": "이전 초대로는 다시 참여할 수 없습니다. 호스트에게 새 초대를 요청하세요.",
diff --git a/apps/mobile/src/i18n/locales/zh-CN/sharedTask.json b/apps/mobile/src/i18n/locales/zh-CN/sharedTask.json
index 3b33eaf385..cfdbfc347d 100644
--- a/apps/mobile/src/i18n/locales/zh-CN/sharedTask.json
+++ b/apps/mobile/src/i18n/locales/zh-CN/sharedTask.json
@@ -11,8 +11,8 @@
"requestJoin": "加入",
"dismiss": "关闭窗口",
"title": "共享任务",
- "hostLimit": "你最多同时开启 2 个共享任务,请先关闭一个再试。",
- "joinLimit": "你最多同时加入 2 个共享任务,请先退出一个再试。",
+ "hostLimit": "开启的共享任务已达当前上限,请关闭共享任务,直到数量低于上限后再试。",
+ "joinLimit": "加入的共享任务已达当前上限,请退出共享任务,直到数量低于上限后再试。",
"guestLimit": "此共享任务已有 2 名访客,暂时无法加入。",
"invitationUnavailable": "邀请无效或已失效,请向房主获取新邀请",
"invitationRenew": "旧邀请无法再次加入,请向房主获取新邀请",
diff --git a/apps/mobile/src/i18n/locales/zh-TW/sharedTask.json b/apps/mobile/src/i18n/locales/zh-TW/sharedTask.json
index 142e18d1e0..66156ea162 100644
--- a/apps/mobile/src/i18n/locales/zh-TW/sharedTask.json
+++ b/apps/mobile/src/i18n/locales/zh-TW/sharedTask.json
@@ -11,8 +11,8 @@
"requestJoin": "加入",
"dismiss": "關閉視窗",
"title": "共享任務",
- "hostLimit": "你最多同時開啟 2 個共享任務,請先關閉一個再試。",
- "joinLimit": "你最多同時加入 2 個共享任務,請先退出一個再試。",
+ "hostLimit": "開啟的共享任務已達目前上限,請關閉共享任務,直到數量低於上限後再試。",
+ "joinLimit": "加入的共享任務已達目前上限,請退出共享任務,直到數量低於上限後再試。",
"guestLimit": "此共享任務已有 2 名訪客,暫時無法加入。",
"invitationUnavailable": "邀請無效或已失效,請向房主取得新邀請",
"invitationRenew": "舊邀請無法再次加入,請向房主取得新邀請",
diff --git a/docs/product-rules/shared-task-mode.md b/docs/product-rules/shared-task-mode.md
index 21bbac9bda..684bb49302 100644
--- a/docs/product-rules/shared-task-mode.md
+++ b/docs/product-rules/shared-task-mode.md
@@ -30,7 +30,7 @@
## 邀请、成员和生命周期
-- 初版为减少服务器与带宽压力,每个账号同时最多开启 2 个共享任务、最多加入 2 个共享任务;两个角色独立计数,可以同时开启 2 个并加入另外 2 个。各自跨设备统计,加入名额跨房主统计。
+- 每个账号同时最多开启 5 个共享任务、最多加入 5 个共享任务;两个角色独立计数,可以同时开启 5 个并加入另外 5 个。各自跨设备统计,加入名额跨房主统计。开启与加入的名额均由服务端判定,客户端不维护固定数量。
- 邀请可转发,持有邀请的登录用户即可加入;每个任务最多 2 位访客(加房主共 3 人),按账号计数。服务端在事务内强制校验,超额分别提示开启、加入或访客人数已满。
- 已存在的超额共享及成员关系不自动关闭或踢出;只拒绝新增开启/加入,退出、移除、关闭或房主离线关闭后释放对应名额。访客临时断线不释放加入名额。
- 同一账号重复加入幂等,多个设备不重复占用名额。邀请令牌只存摘要,不进入日志。
diff --git a/packages/device-link/src/sharedTask.ts b/packages/device-link/src/sharedTask.ts
index 4961e87168..3546545c81 100644
--- a/packages/device-link/src/sharedTask.ts
+++ b/packages/device-link/src/sharedTask.ts
@@ -16,8 +16,6 @@ export function isSharedTaskAttachment(value: string, sharedTaskId: string): boo
}
export const SHARED_TASK_CAPABILITY = 'shared-task-v2';
-export const SHARED_TASK_MAX_ACTIVE_PER_OWNER = 2;
-export const SHARED_TASK_MAX_JOINED_PER_ACCOUNT = 2;
export const SHARED_TASK_MAX_GUESTS = 2;
/** Read existing development snapshots without revoking already joined guests.
* Admission limits are enforced by the server, not by rejecting stored history. */