[Bug]: Contextual bar actions do not work and duplicate reply names are allowed during edits

未关闭
#70 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

  • #71 来自 @sezallagwal —— 已关闭,未合并

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
typescript
领域
full-stack

调研方向

从 ExecuteBlockActionHandler.ts 开始,跟踪上下文栏交互,并在 ReplyStorage.ts 中检查编辑期间的 isUniqueReplyName。重现 /quick list 中的 Send、Edit 和 Delete 操作,然后尝试将回复重命名为已有的名称。所有操作都能执行,并且编辑期间会拒绝重复名称,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug
What happened?

Overview

This issue covers two distinct bugs within the quick replies list (/quick list) and the editing flow.

Bug 1: Send, Edit, and Delete actions in quick replies list do nothing

When opening the quick replies list and clicking Send, Edit, or Delete from the overflow menu (⋮) on any reply, nothing happens — no modal opens, no error is shown.

Root Cause:
In ExecuteBlockActionHandler.ts, the room fallback uses strict equality:
if (room === undefined) {
For contextual bar block interactions, getInteractionData().room returns null (not undefined). The strict check misses null, forcing room to stay null. Following this, the if (room) guard around the Send/Edit/Delete switch evaluates to false, silently skipping the execution of all three actions.


Bug 2: Duplicate reply names allowed when editing

When editing a reply and changing its name to perfectly match another existing reply, the app accepts it and saves it instead of showing a validation error.

Root Cause:
In ReplyStorage.ts, the isUniqueReplyName method has a no-op comparison:

if (replyFound && replyId) {
    replyFound.id === replyId;  // comparison result is discarded!
    return true;                // always returns true
}
Steps to reproduce
  1. Open any channel and run /quick list.
  2. Click the overflow menu (⋮) on any reply.
  3. Click Send, Edit, or Delete.
  4. Expected: A modal opens for the selected action.
  5. Actual: Nothing happens.
Relevant ScreenShots

No response

Version

8.1.1

What browsers are you seeing the problem on?

Chrome

主要语言
TypeScript
星标
7
派生
21
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

RocketChat/Apps.QuickReplies 的其他 Issue

查看 RocketChat/Apps.QuickReplies 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。