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

Abierto
#3,450 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
csharp, openapi

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C#
Estrellas
567
Forks
107
Merge medio
1 h 19 min
PR fusionados (30 d)
353

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de fluentcms/FluentCMS

Todos los issues de fluentcms/FluentCMS

Issues similares

Más issues de C#

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.