Skip to content

fix(agent): 附件上传串行化修并发覆盖丢附件 - #34

Open
Rely-xcy wants to merge 1 commit into
jieapi:mainfrom
Rely-xcy:fix/attachment-upload
Open

Rely-xcy wants to merge 1 commit into
jieapi:mainfrom
Rely-xcy:fix/attachment-upload

Conversation

@Rely-xcy

Copy link
Copy Markdown

概述

  • 现象:附件上传中再次上传,先选文件的预览丢失(但文件已上传成功)。
  • 根因:pendingAttachments = pendingAttachments + uploaded 是读-改-写,两次上传并发时后写覆盖前写。
  • 修复:handlePickedAttachments 用 Mutex 串行化上传流程。
  • 顺带:待发送附件缩略图区保持横向滑动,新附件自动滚到最右、立即可见。

- handlePickedAttachments 用 Mutex 串行化: 两次上传并发时 pendingAttachments 读-改-写互相覆盖, 先选附件预览丢失
- PendingAttachmentPreviewList 保持横向滑动, 新附件加入自动滚到最右保证可见
@coderabbitai

coderabbitai Bot commented Sep 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 15 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 6037679f-6057-4ce2-8115-21dd228c68de

📥 Commits

Reviewing files that changed from the base of the PR and between 7d40c9d and 2fa5ae2.

📒 Files selected for processing (2)
  • app/src/main/java/com/aicode/feature/agent/presentation/component/AIChatPanel.kt
  • app/src/main/java/com/aicode/feature/agent/presentation/component/ChatInputAttachments.kt

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant