Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

getRecipients drops incoming email To recipients from the reply CC

Aperta Adatta ai principianti
#67 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@limehawk ci sta già lavorando.

Dal 10/8/2026.

  • #68 di @limehawk — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
typescript
Ambito
backend

Direzione di ricerca

Inizia da getRecipients e ispeziona il ramo in ingresso in cui viene assegnato emailAttributes.to. Aggiorna la gestione delle email in ingresso ed estendi il fixture createIncomingEmail o i relativi test con un indirizzo della posta in arrivo e un destinatario To aggiuntivo; il lavoro è completato quando il collega compare nel CC della risposta e l'indirizzo della posta in arrivo viene filtrato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

getRecipients builds the reply recipients from the last email in a conversation. For an incoming email, it is expected to move extra To recipients into the reply cc (minus the inbox address). It does not. The incoming branch hardcodes the To list to empty:

if (isIncoming) {
  ...
  emailAttributes = {
    cc: email?.cc || [],
    bcc: email?.bcc || [],
    from: email?.from || [],
    to: [],   // <-- drops the email's actual To recipients
  };
}

So this later step is always a no-op for incoming emails:

// Only include 'to' recipients in cc for incoming emails, not for outgoing
if (Array.isArray(emailAttributes.to) && isIncoming) {
  cc.push(...emailAttributes.to);
}

Effect in Chatwoot: a customer sends an email to the inbox with a colleague in the To line (not CC). The agent replies from the dashboard. The reply box computes an empty CC and the colleague silently falls off the thread.

Repro:

getRecipients(
  incomingEmail({ from: ['[email protected]'], to: ['[email protected]', '[email protected]'] }),
  '[email protected]',
  '[email protected]',
  ''
);
// actual:   cc = []
// expected: cc = ['[email protected]']

Regression: before #43 the function read the raw email object, so emailAttributes.to held the real To list and the cc.push worked. #43 restructured the branches and zeroed to for incoming; #50 kept the guard but the array is always empty. There is no test covering an incoming email with extra To recipients — the createIncomingEmail fixture has no to field at all.

Fix incoming: pass email?.to || [] so the existing cc-building step and filters work again.

Lingua principale
TypeScript
Stelle
11
Fork
14
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di chatwoot/utils

Tutte le issue di chatwoot/utils

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.