Request a Copy: repeated clicks on submit / send create duplicate requests and emails

Abierto
#6,541 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
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
40/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
angular, typescript
Área
frontend

Línea de trabajo

The three affected actions are onSubmit() in the Request a Copy page and grant() and deny() in the response-form components, which the issue links to bitstream-request-a-copy-page, grant-request-copy and deny-request-copy. Check where each button's disabled binding is set and where the REST call is dispatched, and confirm nothing guards against a call already in flight. Done means one click produces one request, the button is disabled with a spinner while pending, and it re-enables after a network error. The author says they plan to open a PR, so coordinate before starting.

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

Descripción

bug needs triage

Describe the bug

The Request a Copy form and the grant/deny email response forms do not prevent repeated submissions while a request is in flight. Each additional click on the submit button fires another REST request, causing the backend to create several identical item requests and dispatch multiple duplicate notification emails to authors and submitters.

Affected buttons:

  • "Request copy" on the initial request form (bitstream-request-a-copy-page)

  • "Send" on the grant email form (grant-request-copy)

  • "Send" on the deny email form (deny-request-copy)

  • DSpace Version(s): Seen on DSpace 10.1 and confirmed on main. The buttons are only disabled when the form is invalid (requestCopyForm.invalid), but onSubmit(), grant(), and deny() have no in-flight execution check.

  • Web Browser: Chrome 131, Firefox 132 (reproducible across all browsers).

To Reproduce

Steps to reproduce the behavior:

  1. Navigate to an item containing a restricted bitstream and click the file link to reach the Request a Copy form.
  2. Fill in the required fields (name, email, and message).
  3. In browser Developer Tools (Network tab), throttle network speed (e.g. to "Slow 3G") so the REST request takes 2–3 seconds.
  4. Click the "Request copy" button 3 or 4 times rapidly before the page redirects.
  5. In the browser Network tab, observe multiple parallel POST /server/api/core/itemrequests requests sent (one for each click).
  6. The item contact receives multiple duplicate email notifications for the same request.

(The same behavior can be reproduced on the grant and deny response forms by clicking "Send" repeatedly).

Expected behavior

  • One submission should create exactly one item request and send one set of emails.
  • While the request is in flight, the button should immediately be disabled and display a loading/spinner state.
  • If the request encounters a network error, the button should become active again so the user can retry.

Related work

I have a UI fix ready (in-flight guard, disabled state, and spinner icon on all three buttons) and will open a pull request for this issue.

Question for maintainers: Would you also recommend adding a backend safeguard in DSpace/DSpace (such as rate-limiting or deduplicating identical requests within a short timeframe), or is the UI in-flight guard sufficient?

Lenguaje dominante
TypeScript
Estrellas
180
Forks
577
Merge medio
2 d 1 h
PR fusionados (30 d)
100

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 DSpace/dspace-angular

Todos los issues de DSpace/dspace-angular

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.