Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Conversation draft turns permanently dirty when applied conversions match no piece

未关闭 适合新手
#3,573 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
83/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

先在会话编辑器代码中找到 useConversationDraft.applyConversions 和相邻的 changePiece;issue 没有指定文件路径或测试。比较它们处理未匹配 piece ID 的方式,然后运行相关的草稿或会话编辑器测试。完成标准是:对缺失的 piece 应用转换后,干净的草稿仍保持干净,并且不会触发确认丢弃的提示。

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

描述

Description

useConversationDraft.applyConversions rebuilds every message and piece wrapper object even when no piece in the draft matches an entry in the applied map. The draft's dirty flag compares the messages array by reference against the baseline, so one such no match call leaves the draft permanently dirty.

The live copy of this logic in ConversationEditor wires the converter panel's apply event, which fires with results that can reference pieces the user has already deleted, so a converter round that changes nothing can leave the editor showing the discard confirmation, Your unsaved changes will be lost, on every later close or navigation.

The sibling changePiece in the same hook already tracks a changed flag and returns the original array when nothing matched; applyConversions lacks that guard.

Expected Behavior

Applying conversions that match no piece in the draft should leave the draft clean.

Reproduction Steps

  1. Open a conversation draft and open the converter panel.
  2. Delete the piece a conversion result refers to, then let the panel emit its apply event.
  3. Close the draft: the discard confirmation appears even though nothing changed.

Minimal Reproduction

Call applyConversions({ missingPieceId: ... }) on a clean draft and read dirty.

Environment

PyRIT main.

主要语言
Python
星标
4.7k
派生
980
平均合并
2 天 9 小时
30 天内合并 PR
422

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

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

从这里开始

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

microsoft/PyRIT 的其他 Issue

查看 microsoft/PyRIT 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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