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

Follow-up classifier job fails when sent message is also in INBOX

Aperta Adatta ai principianti
#13,731 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Inizia in apps/mail/lib/BackgroundJob/FollowUpClassifierJob.php intorno alla riga 70 e verifica come vengono filtrati i messaggi provenienti da getByMessageId() prima di chiamare ThreadMapper::findNewerMessageIdsInThread(). Riproduci il caso in cui un messaggio inviato appare anche in INBOX, quindi verifica che il job accodato non sollevi più il TypeError e che il messaggio inviato riceva la classificazione di follow-up.

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

Descrizione

0. to triage bug
Steps to reproduce
  1. Enable LLM processing in Mail (I use integration_openai as the text2text provider)
  2. Send a mail where a copy also ends up in INBOX of the same account (e.g. Bcc to yourself)
  3. Wait for FollowUpClassifierJob to run for it
Expected behavior

Message gets classified like any other sent message.

Actual behavior

The job crashes with a TypeError:

Undefined array key 0 at apps/mail/lib/BackgroundJob/FollowUpClassifierJob.php#70
TypeError: OCA\Mail\Db\ThreadMapper::findNewerMessageIdsInThread(): Argument #2 ($message) must be of type OCA\Mail\Db\Message, null given, called in .../FollowUpClassifierJob.php on line 73

Since it's a QueuedJob it's already removed from the job list at that point, so the message never gets a follow-up check.

I think the problem is that array_filter() keeps the original keys. getByMessageId() returns both the INBOX and the Sent copy, the INBOX one comes first, so after filtering the Sent message is at index 1 and $messages[0] is null. Wrapping it in array_values() should fix it.

Looks like main still has the same code.

Mail app version

5.12.2

Nextcloud version

34.0.4

Mailserver or service

Own IMAP server

Operating system

AlmaLinux 9.8

PHP engine version

PHP 8.2

Nextcloud memory caching

APCu

Web server

Apache (supported)

Database

MySQL

Additional info

In my case 6 of 60 sent messages failed, and those were exactly the 6 that also had a copy in INBOX. All the others went through fine.

Lingua principale
JavaScript
Stelle
1k
Fork
348
Merge medio
1g 19h
PR unite (30g)
90

Preparare l'ambiente

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 nextcloud/mail

Tutte le issue di nextcloud/mail

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.