SharesUpdatedListener doesn't restore the home setup listener state on errors

Abierto Apto para principiantes
#67,590 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
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
php
Área
backend, testing

Línea de trabajo

Lee apps/files_sharing/lib/Listener/SharesUpdatedListener.php, especialmente los cambios de estado del listener alrededor de las líneas 71 y 137, y revisa el test que cubre SharesUpdatedListener. Comprueba cómo se comporta el estado cuando un callback lanza una excepción y, después, ejecuta el test correspondiente. El trabajo estará terminado cuando se restaure el estado anterior de UserHomeSetupListener después de un error y el test cubra ese caso.

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

Descripción

1. to develop bug feature: sharing
Bug description

SharesUpdatedListener::handle() disables the UserHomeSetupListener while it updates shares and restores the old state at the end:

https://github.com/nextcloud/server/blob/3a68340a6c806a18cdd0d9667a3b9ec5f096b135/apps/files_sharing/lib/Listener/SharesUpdatedListener.php#L71
https://github.com/nextcloud/server/blob/3a68340a6c806a18cdd0d9667a3b9ec5f096b135/apps/files_sharing/lib/Listener/SharesUpdatedListener.php#L137

The restore is not in a finally, so if one of the callbacks throws (as in #67014), the home setup listener stays disabled for the rest of the request and pending share refreshes aren't run on later home folder setups in that request.

Steps to reproduce

Found by code reading.

  1. Trigger a share update (e.g. add a user to a group with shares) where a share target validation listener throws.
  2. Later file system setups in the same request skip the share refresh.
Expected behavior

The old state is restored in a finally block, covered by a test.

Nextcloud version

master

Lenguaje dominante
PHP
Estrellas
37.7k
Forks
5.4k
Merge medio
1 d 23 h
PR fusionados (30 d)
585

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

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 nextcloud/server

Todos los issues de nextcloud/server

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.