htmx requests that error fail silently

Abierto
#381 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
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
57/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
javascript, ruby
Área
frontend

Línea de trabajo

Start by locating the application and backend entrypoints and how their JavaScript is loaded. Check how the 500 page exposes data-error-id and how existing toast notifications are implemented. Done means htmx response and network errors show the specified messages, with the Sentry event id copyable when present.

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

Descripción

Errors now render real 500/404 pages instead of redirecting home with a flash. htmx doesn't swap non-2xx responses by default, so when an `hx-*` request errors, nothing visible happens. (Before, htmx followed the redirect and swapped the home page into the target, which was also wrong.)

Proposal: a small global handler loaded in both the `application` and `backend` entrypoints:

  • on `htmx:responseError`, show a dismissable toast with a message for the status:
    • 404: "couldn't find that"
    • 403: "you don't have permission"
    • 422: "refresh and try again"
    • otherwise: "something went wrong"
  • when the 500 page includes a Sentry event id (`data-error-id`), show that id with click-to-copy.
  • on `htmx:sendError` (network failure), show a "couldn't reach the server" toast.
Lenguaje dominante
Ruby
Estrellas
85
Forks
72
Merge medio
3 d 12 h
PR fusionados (30 d)
22

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 hackclub/auth

Todos los issues de hackclub/auth

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.