Deleting/updating file attachments fails with 404 — frontend calls singular attachment/{type}:{id} but OCS route is plural attachments/{id}
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
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- javascript, php
Línea de trabajo
Comienza con src/services/attachment.js y compara deleteAttachment(), updateAttachment() y restoreAttachment() con las rutas OCS de appinfo/routes.php y AttachmentOcsController. Verifica la ruta y los parámetros de la solicitud con respecto a la llamada DELETE confirmada como funcional y, a continuación, prueba la eliminación, actualización y restauración de un archivo adjunto para confirmar que las tres operaciones tienen éxito.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
Removing a file attachment (a file shared from Files, type: file) from a card via the sidebar (⋯ → Remove attachment) does nothing. The DELETE request returns HTTP 404 / OCS statuscode: 998 ("Invalid query"). The same mismatch affects updating and restoring attachments.
Steps to reproduce
Add a file to a card via "Share from Files" (creates a share_type 12 attachment).
Open the card, ⋯ on the attachment → Remove attachment.
Nothing happens; the Network tab shows a failed DELETE.
Actual request (fails):
DELETE /ocs/v2.php/apps/deck/api/v1.0/cards/52/attachment/file:198?boardId=7
→ 404, {"ocs":{"meta":{"status":"failure","statuscode":998,"message":"Invalid query, ..."}}}
Root cause
The frontend AttachmentApi builds the URL with singular attachment/ and a composite type🆔
// src/services/attachment.js (as shipped in js/deck-main.js)
async deleteAttachment(attachment, boardId) {
await axios({ method: 'DELETE',
url: this.ocsUrl(/cards/${attachment.cardId}/attachment/${attachment.type}:${attachment.id}),
params: { boardId: boardId ?? null } })
}
// updateAttachment() and restoreAttachment() use the same singular attachment/${type}:${id} scheme
But the OCS routes register delete/update/restore under plural attachments/{attachmentId} with type as a separate parameter:
// appinfo/routes.php (ocs)
['name' => 'attachment_ocs#delete', 'url' => '/api/v{apiVersion}/cards/{cardId}/attachments/{attachmentId}', 'verb' => 'DELETE'],
// AttachmentOcsController::delete(int $cardId, int $attachmentId, string $type = 'file', ?int $boardId = null)
So the singular path matches no OCS route → 998/404. (createAttachment POST /cards/{cardId}/attachment and getAll /cards/{cardId}/attachments both match fine — only delete/update/restore are inconsistent.)
Confirmed working call (proves the backend is fine, only the frontend URL is wrong):
DELETE /ocs/v2.php/apps/deck/api/v1.0/cards/52/attachments/198?type=file&boardId=7
→ 200 OK (share removed, source file kept)
Suggested fix
Align the frontend AttachmentApi delete/update/restore to /cards/${cardId}/attachments/${attachment.id} and pass type via params (matching the OCS controller). The shipped 1.18.2 JS bundle appears out of sync with the OCS routes.
Server configuration
Nextcloud: 34.0.1
Deck: 1.18.2 (files verified against the official signature.json — unmodified)
DB: MySQL · PHP 8.x · nginx (YunoHost)
Browser: Chrome 149
- Lenguaje dominante
- JavaScript
- Estrellas
- 1.4k
- Forks
- 358
- Merge medio
- 2 d 18 h
- PR fusionados (30 d)
- 83
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 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 38 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
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 38 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
nextcloud/deck#8334 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Date picker should automatically open popupPosiblemente ocupada @theoholl la tomó hace 46 días. Abierto1. to develop enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
nextcloud/deck#8110 · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de nextcloud/deck
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
521xueweihan/HelloGitHub#4025 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
iib0011/omni-tools#479 ·
Los mantenedores suelen responder en 1 día
-
triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
pixelfed/pixelfed-rn#508 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
yetone/magpie#2844 · 1 comentario ·
Los mantenedores suelen responder en 1 día