A write of the user's preferences replaces every value and has no ETag, so two tabs can undo each other

未关闭
#3,450 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
55/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp, openapi

调研方向

Start with OperationsEndpoints.cs lines 204–217 and the preferences model and request body in UserPreferences.cs and AdminBodies.cs; compare conditional writes on the content routes. Then check the account page in AccountPreferences.razor and the backend and admin specifications. Add the route and tests so updating one preference preserves the stored others, concurrent changes to different preferences both persist, and the route appears in OpenAPI.

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

描述

area:api type:feature

Problem

PUT /me/preferences replaces culture, timeZone, dateFormat and numberFormat together: a member left out or null is stored as not chosen (src/FluentCMS.Core/Identity/UserPreferences.cs, lines 44 to 47; src/FluentCMS.Core/Api/Management/AdminBodies.cs, line 295). GET /me/preferences answers no ETag and the write takes no If-Match (OperationsEndpoints.cs, lines 204 to 217). The account page of the admin changes one preference at a time, so it must send the three others as it last read them. With two tabs, or two devices, a change of the time zone in one is undone by a change of the language in the other. #3214 asks that this cannot happen, and the admin can only narrow the window by reading again just before it writes (admin/src/FluentCMS.Admin/Account/AccountPreferences.razor, lines 119 and 120). A-41 adds three more controls to the same card.

Proposal

Let a caller change one member: a PATCH /me/preferences that changes the members it names and keeps the rest, with null for "not chosen"; or an ETag on the read with If-Match on the write, as the content routes have. The first is what the admin would use. In the OpenAPI document.

Acceptance

  • A change of one preference keeps the three others as they are stored, whatever the caller last read
  • Two changes of different preferences sent at once are both stored
  • The route is in the OpenAPI document, with tests; the backend and admin specifications name it

Found in the audit of the Management API for A7 (20 Nov 2026); second acceptance line of #3214. Needed by A-41, which until then reads just before it writes. Size: S.

主要语言
C#
星标
567
派生
107
平均合并
1 小时 19 分钟
30 天内合并 PR
353

环境准备

从这里开始

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

fluentcms/FluentCMS 的其他 Issue

查看 fluentcms/FluentCMS 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

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