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(mobile): purge invitation history on expiry and account cleanup

DavidShen9a473fb71f93
diff --git a/apps/mobile/src/__tests__/accountDeletion.test.ts b/apps/mobile/src/__tests__/accountDeletion.test.ts
index 39f4d608b8..0ebe76a2ff 100644
--- a/apps/mobile/src/__tests__/accountDeletion.test.ts
+++ b/apps/mobile/src/__tests__/accountDeletion.test.ts
@@ -10,6 +10,20 @@ function source(path: string): string {
}
describe("mobile account deletion", () => {
+ it('invalidates invitation history before asynchronous terminal cleanup, without clearing it on account switches', () => {
+ const context = source('src/auth/AuthContext.tsx');
+ const start = context.indexOf('const clearLocalSession = useCallback');
+ const body = context.slice(start, context.indexOf('const terminateSession', start));
+ const capture = body.indexOf('const invitationHistoryOwner = getMobileAuthOwner();');
+ const invalidate = body.indexOf('setMobileAuthOwner(null);');
+ const clear = body.indexOf('clearClipboardInvitationHistory(invitationHistoryOwner.accountKey)');
+ expect(capture).toBeGreaterThan(-1);
+ expect(invalidate).toBeGreaterThan(capture);
+ expect(clear).toBeGreaterThan(invalidate);
+ expect(clear).toBeLessThan(body.indexOf('await unregisterPushTokenBestEffort'));
+ expect(body).toContain('await clearInvitationHistory;');
+ expect(context.slice(0, start)).not.toContain('clearClipboardInvitationHistory(');
+ });
it("lets auth-server eligibility exclusively control settings visibility", () => {
const settings = source("app/settings.tsx");
const visibilityBlock = settings.slice(
diff --git a/apps/mobile/src/__tests__/clipboardInvitationHistory.test.ts b/apps/mobile/src/__tests__/clipboardInvitationHistory.test.ts
index 882625b6af..bec2721c21 100644
--- a/apps/mobile/src/__tests__/clipboardInvitationHistory.test.ts
+++ b/apps/mobile/src/__tests__/clipboardInvitationHistory.test.ts
@@ -1,8 +1,8 @@
import { afterEach, beforeEach, expect, it, vi } from 'vitest';
-const storage = vi.hoisted(() => ({ values: new Map<string, string>(), getItem: vi.fn(), setItem: vi.fn() }));
+const storage = vi.hoisted(() => ({ values: new Map<string, string>(), getItem: vi.fn(), setItem: vi.fn(), removeItem: vi.fn() }));
vi.mock('@react-native-async-storage/async-storage', () => ({ default: storage }));
-import { __testing, hasSeenClipboardInvitation, invitationDigest, rememberClipboardInvitation } from '@/device-link/clipboardInvitationHistory';
+import { __testing, clearClipboardInvitationHistory, hasSeenClipboardInvitation, invitationDigest, rememberClipboardInvitation } from '@/device-link/clipboardInvitationHistory';
const account = '["global","guest"]';
const key = __testing.storageKey(account);
@@ -14,6 +14,7 @@ beforeEach(() => {
__testing.reset(); storage.values.clear();
storage.getItem.mockReset().mockImplementation(async (k: string) => storage.values.get(k) ?? null);
storage.setItem.mockReset().mockImplementation(async (k: string, value: string) => { storage.values.set(k, value); });
+ storage.removeItem.mockReset().mockImplementation(async (k: string) => { storage.values.delete(k); });
});
afterEach(async () => { await __testing.flush(); vi.useRealTimers(); });
@@ -34,6 +35,7 @@ it('expires records at 30 days without extending TTL on reads', async () => {
expect(await hasSeenClipboardInvitation(account, digest)).toBe(true);
vi.setSystemTime(Date.now() + day);
expect(await hasSeenClipboardInvitation(account, digest)).toBe(false);
+ expect(storage.values.has(key)).toBe(false);
__testing.reset();
expect(await hasSeenClipboardInvitation(account, digest)).toBe(false);
await rememberClipboardInvitation(account, invitationDigest('new'));
@@ -117,3 +119,77 @@ it('never stores an invitation before an account is known', async () => {
expect(storage.getItem).not.toHaveBeenCalled();
expect(storage.setItem).not.toHaveBeenCalled();
});
+
+it('persists pruning on a cold read and retains only unexpired records without a new invitation', async () => {
+ const fresh = invitationDigest('fresh');
+ storage.values.set(key, JSON.stringify({ version: 1, entries: [
+ { digest, seenAt: Date.now() - 31 * day }, { digest: fresh, seenAt: Date.now() - day },
+ ] }));
+ expect(await hasSeenClipboardInvitation(account, digest)).toBe(false);
+ expect(JSON.parse(storage.values.get(key)!).entries).toEqual([{ digest: fresh, seenAt: Date.now() - day }]);
+ await hasSeenClipboardInvitation(account, fresh);
+ expect(storage.setItem).toHaveBeenCalledTimes(1);
+});
+
+it('retries failed expiry cleanup without treating expired records as seen', async () => {
+ await rememberClipboardInvitation(account, digest);
+ vi.setSystemTime(Date.now() + 30 * day);
+ storage.removeItem.mockRejectedValueOnce(new Error('unavailable'));
+ expect(await hasSeenClipboardInvitation(account, digest)).toBe(false);
+ expect(storage.values.has(key)).toBe(true);
+ expect(await hasSeenClipboardInvitation(account, digest)).toBe(false);
+ expect(storage.values.has(key)).toBe(false);
+});
+
+it('does not overwrite a fresh invitation when TTL cleanup is queued behind an older write', async () => {
+ await rememberClipboardInvitation(account, digest);
+ let finish!: () => void;
+ storage.setItem.mockImplementationOnce(async (k: string, value: string) => {
+ await new Promise<void>(resolve => { finish = resolve; }); storage.values.set(k, value);
+ });
+ const oldWrite = rememberClipboardInvitation(account, invitationDigest('old'));
+ await vi.waitFor(() => expect(finish).toBeDefined());
+ vi.setSystemTime(Date.now() + 31 * day);
+ const cleanup = hasSeenClipboardInvitation(account, digest);
+ const fresh = invitationDigest('fresh');
+ const newWrite = rememberClipboardInvitation(account, fresh);
+ finish(); await Promise.all([oldWrite, cleanup, newWrite]);
+ expect(JSON.parse(storage.values.get(key)!).entries).toEqual([{ digest: fresh, seenAt: Date.now() }]);
+});
+
+it.each(['read', 'write'] as const)('clears both memory and disk after an in-flight %s without touching another account', async operation => {
+ await rememberClipboardInvitation('other-account', digest);
+ let finish!: () => void;
+ if (operation === 'read') {
+ storage.getItem.mockImplementationOnce(async () => {
+ await new Promise<void>(resolve => { finish = resolve; });
+ return JSON.stringify({ version: 1, entries: [{ digest, seenAt: Date.now() }] });
+ });
+ } else {
+ storage.setItem.mockImplementationOnce(async (k: string, value: string) => {
+ await new Promise<void>(resolve => { finish = resolve; }); storage.values.set(k, value);
+ });
+ }
+ const writing = rememberClipboardInvitation(account, digest);
+ await vi.waitFor(() => expect(finish).toBeDefined());
+ const clearing = clearClipboardInvitationHistory(account);
+ expect(clearClipboardInvitationHistory(account)).toBe(clearing);
+ await rememberClipboardInvitation(account, invitationDigest('late'));
+ finish(); await Promise.all([writing, clearing]);
+ expect(storage.values.has(key)).toBe(false);
+ expect(await hasSeenClipboardInvitation(account, digest)).toBe(false);
+ expect(await hasSeenClipboardInvitation('other-account', digest)).toBe(true);
+ // A later login can record fresh offers again.
+ await rememberClipboardInvitation(account, digest);
+ expect(await hasSeenClipboardInvitation(account, digest)).toBe(true);
+});
+
+it('clears an account that was never loaded and permits a failed removal to be retried', async () => {
+ storage.values.set(key, JSON.stringify({ version: 1, entries: [{ digest, seenAt: Date.now() }] }));
+ storage.removeItem.mockRejectedValueOnce(new Error('unavailable'));
+ await expect(clearClipboardInvitationHistory(account)).rejects.toThrow('unavailable');
+ expect(await hasSeenClipboardInvitation(account, digest)).toBe(false);
+ expect(storage.values.has(key)).toBe(false);
+ await rememberClipboardInvitation(account, digest);
+ expect(await hasSeenClipboardInvitation(account, digest)).toBe(true);
+});
diff --git a/apps/mobile/src/auth/AuthContext.tsx b/apps/mobile/src/auth/AuthContext.tsx
index e842a10f56..460ed52180 100644
--- a/apps/mobile/src/auth/AuthContext.tsx
+++ b/apps/mobile/src/auth/AuthContext.tsx
@@ -121,7 +121,8 @@ import { resetAgentCapabilitiesCache } from '@/session/agentCapabilitiesCache';
import { resetComposerPaletteCache } from '@/session/composerPaletteCache';
import { clearRemoteResourceCache } from '@/device-link/remoteResourceCache';
import { clearCachedHomeListSnapshot } from '@/session/mobileHomeListCache';
-import { invalidateMobileAuthOwnerForSwitch, setMobileAuthOwner } from '@/auth/authOwnerGeneration';
+import { getMobileAuthOwner, invalidateMobileAuthOwnerForSwitch, setMobileAuthOwner } from '@/auth/authOwnerGeneration';
+import { clearClipboardInvitationHistory } from '@/device-link/clipboardInvitationHistory';
import { updateCredentialAccessToken } from '@/remote-desktop/credentialIdentity';
import { clearCachedSessionMessages } from '@/session/mobileSessionMessageCache';
import { clearHistoryDisk } from '@/session/remoteHistoryDiskCache';
@@ -2661,7 +2662,9 @@ export function AuthProvider({ children }: { children: ReactNode }) {
// 继续收到旧账号的任务通知。token 此刻可能已失效(账号不可用),失败静默,
// 残留由 server 侧 APNs 410 回收与换账号重注册的让位逻辑兜底。
// Invalidate in-flight remote creates before any async logout cleanup begins.
+ const invitationHistoryOwner = getMobileAuthOwner();
setMobileAuthOwner(null);
+ const clearInvitationHistory = clearClipboardInvitationHistory(invitationHistoryOwner.accountKey).catch(() => undefined);
setAccountGeneration((value) => value + 1);
// 同步失效认证代次,必须早于第一个 await。否则推送 token 注销的网络等待窗口内,
// 迟到的 canary / XD beta 探测仍会把旧账号结果写回本地。
@@ -2702,6 +2705,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
await clearCachedHomeListSnapshot().catch(() => undefined);
resetComposerPaletteCache();
resetAgentCapabilitiesCache();
+ await clearInvitationHistory;
await clearCanaryChannel().catch(() => undefined);
// 使用统计的同意记录也随登出清除。手机端没有游客模式:登出后 NavigationGate 会
// 把所有路由重定向到 /login,设置页里的统计开关从此不可达。保留同意会让用户处在
diff --git a/apps/mobile/src/auth/__tests__/mobileAccountVault.test.ts b/apps/mobile/src/auth/__tests__/mobileAccountVault.test.ts
index 6b7ffa0b90..75d71881ea 100644
--- a/apps/mobile/src/auth/__tests__/mobileAccountVault.test.ts
+++ b/apps/mobile/src/auth/__tests__/mobileAccountVault.test.ts
@@ -10,6 +10,8 @@ const secureStorage = vi.hoisted(() => ({
secureStorage.value = value;
}),
}));
+const invitationHistory = vi.hoisted(() => ({ clear: vi.fn(async (_key: string) => undefined) }));
+vi.mock('@/device-link/clipboardInvitationHistory', () => ({ clearClipboardInvitationHistory: invitationHistory.clear }));
vi.mock('../secureStorage', () => ({
deleteSecureItem: secureStorage.delete,
@@ -31,6 +33,7 @@ import {
parseMobileAccountVault,
reconcileMobileActiveAuthSession,
removeMobilePassportSessionIfCurrent,
+ removeMobilePassport,
removeMobileResourceSessionIfCurrent,
replaceMobilePassportSessionIfCurrent,
replaceMobileResourceSessionIfCurrent,
@@ -55,6 +58,42 @@ describe('mobile account vault', () => {
secureStorage.value = null;
secureStorage.readError = null;
vi.clearAllMocks();
+ invitationHistory.clear.mockReset().mockResolvedValue(undefined);
+ });
+
+ it('cleans every invitation history belonging to a deleted Passport, preserving another active account and realm', async () => {
+ const deleted = JSON.stringify(['global', metadata.membershipId]);
+ const memberOnly = JSON.stringify(['global', 'member-only']);
+ const other = JSON.stringify(['global', 'other']);
+ const cn = JSON.stringify(['cn', metadata.membershipId]);
+ await mutateMobileAccountVault(vault => {
+ vault.resources[deleted] = { realm: 'global', refreshToken: 'fake-deleted', metadata, lastUsedAt: 1 };
+ vault.resources[cn] = { realm: 'cn', refreshToken: 'fake-cn', metadata, lastUsedAt: 1 };
+ vault.resources[other] = { realm: 'global', refreshToken: 'fake-other', metadata: { ...metadata, membershipId: 'other', passportId: 'other-passport' }, lastUsedAt: 1 };
+ vault.passports[JSON.stringify(['global', metadata.passportId])] = {
+ realm: 'global', passportId: metadata.passportId, accountRefreshToken: 'fake-passport',
+ memberships: [metadata, { ...metadata, membershipId: 'member-only' }],
+ };
+ vault.activeAccountKey = other;
+ });
+ await removeMobilePassport('global', metadata.passportId);
+ expect(invitationHistory.clear.mock.calls.map(([key]) => key).sort()).toEqual([deleted, memberOnly].sort());
+ const vault = parseMobileAccountVault(secureStorage.value);
+ expect(vault.activeAccountKey).toBe(other);
+ expect(Object.keys(vault.resources).sort()).toEqual([cn, other].sort());
+ expect(vault.passports).toEqual({});
+ });
+
+ it('still removes revoked credentials when invitation-history deletion fails', async () => {
+ const key = JSON.stringify(['global', metadata.membershipId]);
+ await mutateMobileAccountVault(vault => {
+ vault.resources[key] = { realm: 'global', refreshToken: 'fake-token', metadata, lastUsedAt: 1 };
+ vault.activeAccountKey = key;
+ });
+ invitationHistory.clear.mockRejectedValueOnce(new Error('storage unavailable'));
+ await removeMobilePassport('global', metadata.passportId);
+ expect(invitationHistory.clear).toHaveBeenCalledWith(key);
+ expect(parseMobileAccountVault(secureStorage.value).resources).toEqual({});
});
it('falls back to an empty read-only projection for malformed encrypted content', () => {
diff --git a/apps/mobile/src/auth/mobileAccountVault.ts b/apps/mobile/src/auth/mobileAccountVault.ts
index a542948ed4..e8145bd4cc 100644
--- a/apps/mobile/src/auth/mobileAccountVault.ts
+++ b/apps/mobile/src/auth/mobileAccountVault.ts
@@ -651,14 +651,21 @@ export async function removeMobileSavedAccount(accountKey: string): Promise<void
}
export async function removeMobilePassport(realm: AuthRegion, passportId: string): Promise<void> {
- await mutateMobileAccountVault((vault) => {
- delete vault.passports[passportVaultKey(realm, passportId)];
+ const { clearClipboardInvitationHistory } = await import('../device-link/clipboardInvitationHistory');
+ await mutateMobileAccountVault(async (vault) => {
+ const passportKey = passportVaultKey(realm, passportId);
+ const invitationAccounts = new Set((vault.passports[passportKey]?.memberships ?? [])
+ .map(membership => accountVaultKey(realm, membership.membershipId)));
for (const [key, resource] of Object.entries(vault.resources)) {
if (resource.realm === realm && resource.metadata.passportId === passportId) {
+ invitationAccounts.add(key);
delete vault.resources[key];
if (vault.activeAccountKey === key) vault.activeAccountKey = null;
}
}
+ // Also runs when deletion completes after switching to another Passport.
+ await Promise.all([...invitationAccounts].map(key => clearClipboardInvitationHistory(key).catch(() => undefined)));
+ delete vault.passports[passportKey];
});
}
diff --git a/apps/mobile/src/device-link/clipboardInvitationHistory.ts b/apps/mobile/src/device-link/clipboardInvitationHistory.ts
index b3262a7711..8827acf4fb 100644
--- a/apps/mobile/src/device-link/clipboardInvitationHistory.ts
+++ b/apps/mobile/src/device-link/clipboardInvitationHistory.ts
@@ -11,6 +11,9 @@ type History = {
hydrated: boolean;
hydrating: Promise<void> | null;
writes: Promise<void>;
+ persisted: string | null;
+ retired: boolean;
+ clearing: Promise<void> | null;
};
const histories = new Map<string, History>();
@@ -21,7 +24,7 @@ export function invitationDigest(invitation: string): string {
function historyFor(accountKey: string): History {
let history = histories.get(accountKey);
if (!history) {
- history = { entries: [], hydrated: false, hydrating: null, writes: Promise.resolve() };
+ history = { entries: [], hydrated: false, hydrating: null, writes: Promise.resolve(), persisted: null, retired: false, clearing: null };
histories.set(accountKey, history);
}
return history;
@@ -53,12 +56,14 @@ function parse(raw: string | null): Entry[] {
}
async function hydrate(accountKey: string, history: History): Promise<void> {
- if (history.hydrated) return;
+ if (history.hydrated || history.retired) return;
if (!history.hydrating) {
history.hydrating = AsyncStorage.getItem(PREFIX + accountKey).then(raw => {
+ if (history.retired) return;
// Invitations can be offered while this read is in flight. Preserve those records.
history.entries = prune([...history.entries, ...parse(raw)]);
history.hydrated = true;
+ history.persisted = raw;
}).catch(() => {
// Retry later; an unread history must never be overwritten by an empty cache.
}).finally(() => { history.hydrating = null; });
@@ -70,8 +75,16 @@ async function hydrate(accountKey: string, history: History): Promise<void> {
export async function hasSeenClipboardInvitation(accountKey: string, digest: string): Promise<boolean> {
if (!accountKey) return false;
const history = historyFor(accountKey);
+ if (history.retired) {
+ // A failed terminal cleanup must not disable deduplication for a later login.
+ if (!history.clearing) await clearClipboardInvitationHistory(accountKey).catch(() => undefined);
+ return false;
+ }
await hydrate(accountKey, history);
+ if (history.retired) return false;
history.entries = prune(history.entries);
+ // Persist expiry/normalization even when no new invitation is recorded.
+ if (history.hydrated) await persistHistory(accountKey, history);
return history.entries.some(entry => entry.digest === digest);
}
@@ -79,18 +92,45 @@ export async function hasSeenClipboardInvitation(accountKey: string, digest: str
export function rememberClipboardInvitation(accountKey: string, digest: string): Promise<void> {
if (!accountKey) return Promise.resolve();
const history = historyFor(accountKey);
+ if (history.retired) return Promise.resolve();
history.entries = prune([{ digest, seenAt: Date.now() }, ...history.entries]);
+ return persistHistory(accountKey, history);
+}
+
+function persistHistory(accountKey: string, history: History): Promise<void> {
history.writes = history.writes.then(async () => {
await hydrate(accountKey, history);
- if (!history.hydrated) return;
+ if (!history.hydrated || history.retired) return;
history.entries = prune(history.entries);
- await AsyncStorage.setItem(PREFIX + accountKey, JSON.stringify({ version: 1, entries: history.entries }));
+ const value = history.entries.length ? JSON.stringify({ version: 1, entries: history.entries }) : null;
+ if (value === history.persisted) return;
+ if (value === null) await AsyncStorage.removeItem(PREFIX + accountKey);
+ else await AsyncStorage.setItem(PREFIX + accountKey, value);
+ history.persisted = value;
}).catch(() => {
// Storage failure must not interrupt admission; memory still deduplicates this run.
});
return history.writes;
}
+/** Invalidate synchronously, then delete after older reads/writes have settled. */
+export function clearClipboardInvitationHistory(accountKey: string): Promise<void> {
+ if (!accountKey) return Promise.resolve();
+ const history = historyFor(accountKey);
+ if (history.clearing) return history.clearing;
+ history.retired = true;
+ history.entries = [];
+ const clearing = history.writes.then(async () => {
+ await history.hydrating;
+ await AsyncStorage.removeItem(PREFIX + accountKey);
+ if (histories.get(accountKey) === history) histories.delete(accountKey);
+ }).finally(() => { history.clearing = null; });
+ history.clearing = clearing;
+ // Keep deletion errors visible to cleanup callers while allowing a later retry.
+ history.writes = clearing.catch(() => undefined);
+ return clearing;
+}
+
export const __testing = {
storageKey: (accountKey: string) => PREFIX + accountKey,
reset: () => histories.clear(),
diff --git a/docs/product-rules/shared-task-mode.md b/docs/product-rules/shared-task-mode.md
index d8e365b99c..45e3bb25f3 100644
--- a/docs/product-rules/shared-task-mode.md
+++ b/docs/product-rules/shared-task-mode.md
@@ -27,7 +27,7 @@
- 客户端只向当前配置的服务提交邀请。链接中的 `server` 仅用于比较,不能覆盖请求目标;不同服务的邀请显示对应提示。仍接受旧的裸邀请码,REST 和 device-link 既有入参保持兼容。
- 访客加入时直接使用已登录用户的账号昵称,不再要求填写自定义昵称。昵称只作为展示信息,成员身份仍由服务端的账号与成员关系决定。
- 移动端登录后在启动或从后台回到前台时自动读取剪贴板,只识别当前服务的有效邀请链接,普通内容与裸邀请码不触发跳转。已提示过的邀请按账号持久化摘要去重,点“暂不加入”或加入后,冷启动与前后台切换均不重放仍在记录内的邀请;剪贴板结果不覆盖已打开的加入页面或更新的链接唤起,异步读取完成后须重新核验账号代次。系统粘贴权限提示引起的短暂失焦不重复读取。菜单不暴露“加入共享任务”入口,页面也不提供独立粘贴按钮。自动识别只打开加入页面,由用户点击加入;显式点击邀请链接继续直接加入并进入任务。
-- 待处理邀请仍只在内存中暂存;去重仅持久化解析后邀请 token 的 SHA-256 摘要与提示时间,每个账号保留最近 16 条、有效期 30 天,内存缓存与落盘采用相同隔离、容量和时效。自动识别仅在确认弹框的原生 onShow 回调中记录摘要,并核验邀请 ID、账号代次与组件仍挂载;启动遮罩期间尚未展示的邀请不记为已提示,不等待加入成功;显式链接在账号归属确定后也记录摘要,但显式链接与设置页手动加入不受去重拦截。此规则是历史邀请去重,不承诺检测复制动作:A→B→A 或重新复制 A,在 A 记录有效时仍不自动提示;过期或容量淘汰后可再次提示。分享标题变化不算新邀请,不清空或改写剪贴板,不落盘剪贴板原文或明文邀请码。存储读取失败不阻断邀请提示,也不覆盖未读出的历史;写入失败保留本次运行的摘要去重,下次冷启动可能再次提示。链接邀请支持首次登录后继续,切换账号、关闭页面或过期后不自动沿用待处理邀请。系统拒绝剪贴板访问时保持当前页面可用,邀请链接唤起仍可使用。
+- 待处理邀请仍只在内存中暂存;去重仅持久化解析后邀请 token 的 SHA-256 摘要与提示时间,每个账号保留最近 16 条、有效期 30 天,内存缓存与落盘采用相同隔离、容量和时效。自动识别仅在确认弹框的原生 onShow 回调中记录摘要,并核验邀请 ID、账号代次与组件仍挂载;启动遮罩期间尚未展示的邀请不记为已提示,不等待加入成功;显式链接在账号归属确定后也记录摘要,但显式链接与设置页手动加入不受去重拦截。此规则是历史邀请去重,不承诺检测复制动作:A→B→A 或重新复制 A,在 A 记录有效时仍不自动提示;过期或容量淘汰后可再次提示。分享标题变化不算新邀请,不清空或改写剪贴板,不落盘剪贴板原文或明文邀请码。查询时淘汰的过期记录同步从磁盘清除,与新增记录共用串行写入队列;应用未运行时不承诺后台定时删除,清理失败在后续访问时重试。退出登录或终止会话清理当前账号历史,账号注销清理该身份在当前区域下的各成员历史,清理先失效内存并等待旧读写完成,避免旧写入恢复记录;普通账号切换不清除去重历史。存储读取失败不阻断邀请提示,也不覆盖未读出的历史;写入失败保留本次运行的摘要去重,下次冷启动可能再次提示。链接邀请支持首次登录后继续,切换账号、关闭页面或过期后不自动沿用待处理邀请。系统拒绝剪贴板访问时保持当前页面可用,邀请链接唤起仍可使用。
- 两端“设置 → 共享任务”提供独立管理页,分为“我发起的 / 我加入的”,有共享和空状态均保留“加入共享任务”次要按钮。手动加入使用紧凑弹框,接受邀请链接和旧裸邀请码;旧裸邀请码不进入自动识别。2026-09-28 用户已确认交互 HTML 并授权实现:Desktop 设置项位于远程控制之后;Mobile 沿用实际设置分组,在语音词典与外观之间增加“共享任务 → 共享管理”。顶部、主菜单和移动端首页共享分组不提供加入入口;桌面端侧栏“共享任务”分组右侧保留“+”加入入口(2026-09-28 用户确认)。
- 自动识别邀请展示账号与加入确认,不暴露长链接或邀请输入框;手动加入和显式链接成功后进入任务。共享结束提示返回任务列表,并说明重新加入需要房主的新邀请。管理页的移除、退出、关闭当前、关闭全部使用紧凑确认;取消保留原页面、页签和滚动位置。加载失败提供重试,不当作空列表;关闭或退出成功回到对应管理列表。
- 本阶段不修改移动端原生配置或 runtime fingerprint;Universal Links / Android App Links 另行实施。先部署服务端页面,再发布客户端;旧客户端尚不能解析新链接,需更新。