Repository navigation
fix(clipboard): 移动端剪贴板双向互通——随 rich 列表并推 case-10 文本、早到文本暂存回灌 - #250
Conversation
…文本暂存待桥就绪回灌,portal 死会话断开后用 wl-copy 回接所有权,补 RPC 内层 schema 观测日志
17a9315 to
47c3449
Compare
|
@hsxian 感谢,移动端剪贴板互通很有用。两点请补充:
🤖 Generated with Claude Code |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 47c3449b33
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@hsxian Codex 审查有三条,已逐条核实成立:
另外上次第 2 点(形状日志上限 400 还原)也请一并处理。改完回复后我再请 Codex 复审。 🤖 Generated with Claude Code |
…c handoff - Push the case-10 ClipboardChange only to controllers verified against it (Android/iOS). Desktop viewers keep the single rich offer, so no control endpoint receives the text twice, and the unverified official-host claim is gone from the comments (review VallierDev#250). - read_text_request takes &mut Assembly; the viewer and host keep one assembly per direction so a split ClipboardChange reassembles instead of applying its last chunk, and the viewer drops a repeat of the text it just applied. - Publish the sink and take the early-held text under one lock, so an older held copy can never overwrite a newer copy that arrived while the bridge started. - Sample clipboard ownership while the session is alive and reclaim the text this session provided after it dies: uu_portal_end/session_closed clear clipboard_owns before the old condition could read it, and clipboard_poll never returned the text we set ourselves. - Shape log cap back to 40.
|
@VallierDev 两点与 Codex 三条均已修,见 d47cb89:
|
|
d47cb89 看过:case-10 只对移动端并推、桌面端维持原路径,删除了无依据的注释;桌面接收端改为持久 Assembly + 判重;早到文本与 sink 发布同锁移交;回接改用会话存活期的所有权快照并补单测。CI 失败是 Ubuntu 软件源超时,已重跑。 @codex review 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d47cb89d16
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
d47cb89 的 Codex 复审又提了两条 P2,核实都成立:
两条合起来看,比较稳妥的做法是把回接放到 Portal 关闭路径本身(关闭前、所有权仍可确认时由 C 侧或其调用方移交),而不是在桥里事后判断;并补一条「先关 TEXT、后关 Portal」的定序测试。如果这部分改动太大,也可以先把 wl-copy 回接拆出去,让本 PR 只保留移动端 case-10 与桌面接收端组装/判重,先合入。 🤖 Generated with Claude Code |
Both fresh P2s hold: ownership sampled while alive goes stale across the close (a local copy during the window gets overwritten by the old text), and the normal teardown ends TEXT before end_idle() closes the portal, so the bridge thread that would reclaim has already exited. A correct reclaim belongs on the portal close path itself, which reaches into C and the main loop; per review, keep this PR to the mobile case-10 pairing and the receiver reassembly/dedup, and land the reclaim separately with ordering tests.
|
按建议把 wl-copy 回接整体拆出(bfe83c1): 两条 P2 的定序问题(关闭期间 |
|
bfe83c1 拆出 wl-copy 回接后本 PR 只剩移动端 case-10 门控与桌面接收端组装/判重,范围清楚。请 Codex 复审;回接的后续 PR 提好后我们再看。 @codex review 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfe83c1d06
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
bfe83c1 的 Codex 复审提了两条新 P2,核实都成立:
改完后我们再请 Codex 复审。 🤖 Generated with Claude Code |
…y the rich replay Rich offers answered before the bridge worker is up dropped their text: only the case-10 branch filled the held slot while the two rich branches required a visible sink. Route all four receive branches through one deliver_or_hold helper. Receiver-side dedup no longer treats the last synced text as the current clipboard: only the immediate rich replay of the just-applied case-10 text is dropped, so a host copy of the same text applies again after a local non-text copy replaced the selection.
|
c7fa896 两条 P2 已修:
测试: |
|
c7fa896 两条 P2 的处理方向符合建议(四个接收分支统一 @codex review 🤖 Generated with Claude Code |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7fa89672b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex 新这条 P2 核实成立: 🤖 Generated with Claude Code |
receive() armed fresh before apply(), so a case-10 write skipped by an unfocused SDL window (Ok(false)) still swallowed the immediate rich replay of the same copy and the clipboard kept the stale value. Keep the text in pending_plain through receive and let apply arm fresh only when the backend write actually landed; skipped or failed writes leave the replay eligible. Sequenced test: case-10, focus-skipped write, rich replay still applies.
|
2ae18e2 已按建议修: |
|
2ae18e2 看过: @codex review 🤖 Generated with Claude Code |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex 复审 2ae18e2 无问题、CI 全绿,已 squash 合并,将随下个版本发布。感谢! 🤖 Generated with Claude Code |
问题
安卓/iOS 控制端与主机之间剪贴板双向都不通:
改动
webrtc.rs:仅对已实测的移动端控制端(连接头部 Android/iOS)随 rich 列表并推 case-10 文本(>8KB 分块);桌面控制端维持只发 rich offer,不会同时收到两种形态clipboard_protocol.rs/viewer:read_text_request改收&mut Assembly,两侧各复用持久 Assembly,多块 ClipboardChange 完整重组,不再把末块当全文;viewer 对已应用文本判重,消除 case-10+rich 双写webrtc.rs:桥 sink 与早到文本合并为同一把锁的状态,「发布 + 回灌」是一次受锁转换,旧文本无法覆盖更新复制wl-copy 所有权回接(portal 会话死亡后桌面剪贴板失效)按复审意见拆为独立后续 PR:两条 P2 表明回接必须放在 Portal 关闭路径本身(关闭时所有权仍可确认),并补「先关 TEXT、后关 Portal」定序测试。
验证
安卓真机双向复制粘贴正常;
--features wayland,portal406 过(唯一失败为本机基线同样失败的 terminal 环境用例),--no-default-features --features inproc-avcheck 过。新增测试:跨请求分块重组、重复应答只写一次。