Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Widget: keep a message sent while offline, and send it when the connection is back

Abierto
#495 3 comentarios 0 reacciones 1 asignado Ver en GitHub

Los mantenedores suelen responder en 1 día

@Saifjafri212213 ya está trabajando en esto.

Desde el 30/10/2026.

  • #502 de @Saifjafri212213 — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

hacktoberfest

F-05 task 18. Today a message sent while offline fails with errorNetwork ("Connection error. Please check your network.", packages/widget/src/i18n.ts:53) and the visitor has to press Retry once they're back online.

What to do

  • Before sending (handleSend, packages/widget/src/widget.ts:738), check navigator.onLine. If offline, show the visitor's message as waiting ("Will send when you're back online", a new string in WidgetLocaleStrings with an English default), and don't call the API.
  • Listen for the online event on window and send what's waiting, in order, one at a time. A message that then fails gets the normal error and Retry.
  • Remove the listener in destroy(). Don't keep waiting messages in storage: they're for this page view only.
  • Going offline in the middle of a reply isn't part of this; that already fails with the network error and Retry.

Acceptance criteria

  • Unit tests with navigator.onLine mocked: a message sent offline isn't sent, it's sent once online fires, two waiting messages go in order, and nothing is left listening after destroy()
  • An e2e test using Playwright's context.setOffline(true), then false, checking the reply arrives without a click
  • The waiting state is announced through the existing reply live region, and the axe checks still pass
  • A minor changeset for @chatcops/widget; pnpm test:coverage, pnpm lint and pnpm size pass

Comment here to be assigned.

Lenguaje dominante
TypeScript
Estrellas
13
Forks
7
Merge medio
3 h 28 min
PR fusionados (30 d)
296

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 codercops/chatcops

Todos los issues de codercops/chatcops

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.