Federated board stacks return 500: getReadMark() called with null user in CardService::enrichCards()
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
Línea de trabajo
El fallo está en CardService::enrichCards() en lib/Service/CardService.php, donde se llama a getReadMark() con un usuario null cuando una tarjeta tiene comentarios. Lee la firma de getReadMark() en el Comments Manager del núcleo de Nextcloud y luego busca dónde el endpoint de stacks construye el usuario para las solicitudes federadas. Está terminado cuando una solicitud sin usuario conectado devuelve el stack sin un TypeError y el recuento de comentarios no leídos se trata como 0 u omite.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
How to use GitHub
- Please use the 👍 reaction to show that you are affected by the same issue.
- Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
- Subscribe to receive notifications on status change and new comments.
Describe the bug
When a board is shared through Deck federation, the remote server's request for the board's stacks fails with HTTP 500 on the owning server whenever a card in the stack has comments. The owning server logs:
OC\Comments\Manager::getReadMark(): Argument #3 ($user) must be of type OCP\IUser, null given,
called in custom_apps/deck/lib/Service/CardService.php on line 88
The federated request (user agent Nextcloud-Server-Crawler/34.0.5) has no logged-in user, so $user is null. CardService::enrichCards() passes it straight to getReadMark() whenever $countComments > 0. The same line is unchanged on main.
On the remote server this surfaces as DeckFederationProxy exceptions (Server error: GET .../ocs/v2.php/apps/deck/api/v1.0/stacks/<id> resulted in a 500), and the federated board does not load for its users.
To Reproduce
- On server A, create a board with a stack containing a card that has at least one comment.
- Share the board with a user on server B via federation.
- As the user on server B, open the federated board.
- Server B logs a 500 from
GET /ocs/v2.php/apps/deck/api/v1.0/stacks/<id>on server A; server A logs thegetReadMark()TypeError above.
Expected behavior
Stacks load for federated users. Unread-comment counts could be skipped (or treated as 0) when there is no local user.
Suggested fix
In CardService::enrichCards(), only call getReadMark() when $user !== null:
$lastRead = ($countComments > 0 && $user !== null)
? $this->commentsManager->getReadMark('deckCard', (string)$card->getId(), $user)
: null;
Server details
- Nextcloud: 34.0.5 (official Docker image)
- Deck: 1.18.5 on the owning server, 1.18.6 on the remote servers
- Database: MariaDB 10.11
- PHP: as shipped in
nextcloud:34.0.5
Log entry on the owning server (trimmed):
"app":"deck","method":"GET","url":"/ocs/v2.php/apps/deck/api/v1.0/stacks/14",
"userAgent":"Nextcloud-Server-Crawler/34.0.5","version":"34.0.5.1",
"Exception":"Exception","Message":"OC\\Comments\\Manager::getReadMark(): Argument #3 ($user) must be of type OCP\\IUser, null given, called in /var/www/html/custom_apps/deck/lib/Service/CardService.php on line 88 in file '/var/www/html/lib/private/Comments/Manager.php' line 1437"
29 occurrences on the owning server in the last week.
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.4k
- Forks
- 363
- Merge medio
- 1 d 5 h
- PR fusionados (30 d)
- 116
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de nextcloud/deck
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
Los mantenedores suelen responder en 1 día
-
DeckProvider::setSubjects() overwrites IEvent subject with translated sentence → InvalidValueException, Deck bell notifications silently droppedPosiblemente ocupada @tcarrondo la tomó hace 11 días. Abierto0. Needs triage bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
nextcloud/deck#8591 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
CSV export leaves trailing commas in tags and assigned-user fieldsPosiblemente ocupada @Kumar-s75 la tomó hace 61 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
nextcloud/deck#8361 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Board clone API failure is treated as a successful board responsePosiblemente ocupada @Kumar-s75 la tomó hace 61 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
Todos los issues de nextcloud/deck
Issues similares
-
status: ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
melodic-software/claude-code-plugins#15008 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
S-Needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
ACK_WAITING HELP_WANTED UPDATE_CS
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
OWASP/CheatSheetSeries#2935 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
docs-external-links-failure
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
ComposioHQ/composio#5297 ·
Los mantenedores suelen responder en 1 día