Skip to content

fix: export link formula collaborator array as nickname in excel - #912

Open
AlexCXC wants to merge 1 commit into
masterfrom
fix-excel-export-link-formula-collaborator-nickname
Open

AlexCXC wants to merge 1 commit into
masterfrom
fix-excel-export-link-formula-collaborator-nickname

Conversation

@AlexCXC

@AlexCXC AlexCXC commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@seafile-dev seafile-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: Comment

Warnings:

  • 缺少链接公式数组协作人导出的回归测试(见行内评论)。
    Suggested fix: 为已命中和未命中 nickname 映射的协作人数组补充导出断言,确保 Excel 中输出昵称且不会回退为用户 ID。

if array_type in (ColumnTypes.CREATOR, ColumnTypes.LAST_MODIFIER):
return email2nickname.get(cell_data2str(item_value), '')
if array_type == ColumnTypes.COLLABORATOR:
return email2nickname.get(cell_data2str(item_value), cell_data2str(item_value))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Warning] 缺少协作人导出回归测试

Why this matters:
这里修复了链接公式数组的协作人显示逻辑,但本 PR 未新增覆盖该分支的测试。后续调整 _extract_display_value、用户映射或未知用户兜底时,Excel 很容易再次导出 ID 而不被发现。

Suggested fix: 增加导出单测,覆盖协作人数组中命中映射、字典 display_value 以及未命中映射三种输入,并断言工作表写入预期昵称/兜底值。

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.

2 participants