BUG: Sharing an album with a very large expiry returns 500 and leaves the share server listening
Los mantenedores suelen responder en 3 días
@swastiksharma45 ya está trabajando en esto.
Desde el 30/11/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 34/100
Línea de trabajo
Read backend/app/schemas/share.py for the expires_in_minutes validation and backend/app/utils/share.py for the order of server startup and registry creation. Start with the share API tests and add coverage for an expiry above the chosen maximum. Done means oversized values return a 422 response without starting the listener; the issue names no test file, so locate the relevant tests in the repository.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Description
POST /share/albums/{album_id} accepts any positive expires_in_minutes. If the value is large enough to push the expiry past year 9999, share_registry_create raises OverflowError: date value out of range. The route only catches OSError, so the client gets a plain-text 500 Internal Server Error.
Worse, share_util_create starts the LAN share server before creating the registry entry, so when this is the first share the listener stays up on the network with zero active shares.
(Note: Checked existing issues including #1635 — #1635 handled the leftover listener on share expiration, whereas this issue is specifically about expires_in_minutes overflowing datetime with OverflowError during creation.)
Steps to reproduce
- Create any album.
POST /share/albums/<album_id>with body{"expires_in_minutes": 5000000000}.- Response is
500 Internal Server Error(plain text, not the usualErrorResponseJSON). GET /share/lists no shares, but the share server is still listening on port 52125.
For comparison, {"expires_in_minutes": 60} returns 200, starts the listener on port 52125 with 1 active share, and revoking it stops the listener (listener running: False). The cut-off is roughly 4.19 billion minutes.
Expected behavior
The request is rejected with a 422 validation error, and the share server is not started.
Cause
backend/app/schemas/share.py:14:expires_in_minuteshasgt=0but no upper bound.backend/app/share/registry.py:82:_now() + timedelta(minutes=...)overflows.backend/app/utils/share.py:92-93:share_server_start()runs beforeshare_registry_create().backend/app/routes/share.py:106: onlyOSErroris handled.
Suggested fix
Add an upper bound to expires_in_minutes (e.g., le= a sane maximum such as 1 year / 525600 minutes) so Pydantic/FastAPI validation rejects oversized values with 422 before the server starts, and add a unit test for oversized expiry values.
The UI only offers fixed expiry presets, so this is reachable through the API rather than the share dialog.
I'd like to work on this if it's approved.
Record
- I agree to follow this project's Code of Conduct
- Lenguaje dominante
- Python
- Estrellas
- 322
- Forks
- 793
- Merge medio
- 6 d 10 h
- PR fusionados (30 d)
- 20
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin 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 AOSSIE-Org/PictoPy
-
bug enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
AOSSIE-Org/PictoPy#1802 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
BUG: XMP metadata export permanently overwrites file modification timestamp (mtime), destroying photo datesPosiblemente ocupada @swastiksharma45 la tomó hace 2 días. Abiertobug enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
AOSSIE-Org/PictoPy#1788 · 6 comentarios ·
Los mantenedores suelen responder en 3 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
AOSSIE-Org/PictoPy#1786 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
BUG: Semantic search sees portrait phone photos sideways (SigLIP ignores EXIF orientation)Posiblemente ocupada @omkar-suryavanshi la tomó hace 3 días. Abiertobug enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
AOSSIE-Org/PictoPy#1780 · 5 comentarios ·
Los mantenedores suelen responder en 3 días
-
BUG: Share password loses leading/trailing spaces so the password you set doesn't workPosiblemente ocupada @ManyaJain111 la tomó hace 2 días. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
AOSSIE-Org/PictoPy#1779 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 3 días
Todos los issues de AOSSIE-Org/PictoPy
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Posiblemente ocupada @cestercian la tomó hoy. Abiertocomp/cli P2 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NousResearch/hermes-agent#162259 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[request] gRpc/1.86.0Abiertoupstream update
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
conan-io/conan-center-index#31597 ·
Los mantenedores suelen responder en 1 día
-
community-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA-NeMo/Run#727 ·
Los mantenedores suelen responder en 1 día
-
bot-triaged module: higher order operators module: pickle module: pt2-dispatcher oncall: pt2 triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
pytorch/pytorch#207247 · 1 comentario ·
Los mantenedores suelen responder en 1 día