[Bug] Clipboard fallback reports success even when copying fails

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

Los mantenedores suelen responder en 1 día

@srikar-naidu ya está trabajando en esto.

Desde el 31/10/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

bug

Describe the bug

The copy actions show a success message even when copying fails. If the modern Clipboard API is unavailable or rejects the request, the fallback uses document.execCommand('copy') but does not verify whether the command succeeded.

To Reproduce

  1. Open the OG image editor.
  2. Block clipboard permissions or use a browser where clipboard access is unavailable.
  3. Click Copy Image URL or Copy Meta Tags.
  4. Observe the notification.

Expected behavior

The app should show a success message only when the content is actually copied. If both copy methods fail, it should display an error message.

Actual behavior

The app shows “URL copied to clipboard!” or “Meta tags copied!” even when the fallback copy operation fails.

Screenshots

Not applicable. A screenshot of the misleading success notification may be added if available.

Environment

  • Browser: Chrome
  • OS: Windows 11
  • Node version: 22.x
  • npm version: 10.x
  • URL: Local OG image editor

Additional context

The fallback currently performs the copy without checking the result:

document.execCommand('copy');
document.body.removeChild(ta);
setCopied(label);
window.showToast?.('URL copied to clipboard!', 'success');

document.execCommand('copy') returns a boolean. The result should be checked, and an error notification should be shown when it returns false or throws.

Lenguaje dominante
TypeScript
Estrellas
8
Forks
4
Merge medio
8 h 47 min
PR fusionados (30 d)
157

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/ogcops

Todos los issues de codercops/ogcops

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.