Skip to content

fix(notifications): avisos manuales solo a usuarios activos - #15

Merged
bpstack merged 2 commits into
claude/compassionate-planck-gh6aoffrom
opencode/fix-notification-recipients
Oct 12, 2026
Merged

bpstack merged 2 commits into
claude/compassionate-planck-gh6aoffrom
opencode/fix-notification-recipients

Conversation

@bpstack

@bpstack bpstack commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Cambios

  • Los avisos manuales (de grupo y generales) responden 400 NOTIFICATIONS_INVALID_RECIPIENTS si algún destinatario está inactivo o no existe, antes de escribir nada.
  • Código nuevo con su texto en es y en.

Por qué

Un usuario inactivo recibía el aviso, y un id desconocido rompía la inserción de destinatarios después de crear la notificación.

- user-repository.ts: getActiveIds returns which of the given ids exist
  and are active.
- notification-controller.ts: the group and general manual notifications
  answer 400 NOTIFICATIONS_INVALID_RECIPIENTS when any recipient is
  inactive or unknown, before anything is written.
- error-codes.ts, errors.json (es, en), errorCodeMessage.ts: the new code
  and its texts.
- manual-recipients.test.ts: both endpoints refuse a bad recipient, send
  to active ones and skip the lookup without userIds.

Why: an inactive user got the notice, and an unknown id broke the
recipients insert after the notification was created. Checked with curl
against the local database: unknown or mixed ids answer 400, an active
one 201.
…test

- manual-recipients.test.ts: mock config/db.js, which the controller loads
  through NotificationRepository.

Why: CI has no backend/.env, so loading the pool config threw "Falta
LOCAL_DB_PASSWORD" and the file failed before any test ran; locally the
.env hid it. Reproduced with LOCAL_DB_PASSWORD empty; now the whole suite
passes that way.
@bpstack
bpstack merged commit cea12ee into claude/compassionate-planck-gh6aof Oct 12, 2026
4 checks passed
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
four-points Ready Ready Preview Oct 12, 2026 6:40pm UTC

@bpstack
bpstack deleted the opencode/fix-notification-recipients branch October 12, 2026 19:02

This branch was successfully deployed

1 active deployment
Preview — 53df2589 Deployed Oct 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant