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

bug: attachment upload notifications are shown again in other channels after switching channel

Aperta
#3,279 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend

Direzione di ricerca

Segui NotificationList attraverso MessageList e VirtualizedMessageList, quindi esamina components/Notifications/notificationTarget.mjs e il middleware delle notifiche degli allegati descritto nell’issue. Verifica in che modo il cambio di canale rimonta la lista mentre client.notifications rimane globale. Il lavoro è completato quando una notifica di caricamento dal canale A non viene renderizzata nuovamente nel canale B, inclusi i caricamenti bloccati e falliti.

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

Descrizione

bug released on @rc status:confirmed

Describe the bug

An attachment upload notification raised in channel A (e.g. validation:attachment:upload:blocked when a file exceeds the upload size limit) is displayed again in channel B after the user switches channel, even though channel B has no upload at all.

The notification itself is only created once — I patched client.notifications.add and confirmed exactly one validation:attachment:upload:blocked entry. What happens is that the same still-alive notification is re-rendered by the newly mounted NotificationList:

client.notifications is a single global store (NotificationManager), not scoped per channel.
NotificationList is rendered by MessageList / VirtualizedMessageList, i.e. inside . Switching the active channel unmounts that list and mounts a new one, which renders whatever is still in the global store.
Panel targeting only distinguishes panel type: isNotificationForPanel() reads target: tags and otherwise falls back to "channel" (components/Notifications/notificationTarget.mjs). There is no scoping by channel instance.
The auto-dismiss timer only starts once a list renders the notification and it is at least 50% visible (IntersectionObserver in NotificationList), so within its 3s lifetime a channel switch shows it again in the new channel.
Integrators cannot filter it out either: the notifications emitted by AttachmentManager carry no channel identity. createBlockedAttachmentUploadNotificationMiddleware sets origin.context = { blockedAttachment } and createUploadErrorHandlerMiddleware sets origin.context = { attachment } — no channel_cid, no composer reference.

Point 5 is the part that makes this unworkable from user land, so I filed it here rather than working around it. The same applies to api:attachment:upload:failed.

To Reproduce

Open channel A and attach a file larger than the upload size limit (default 100 MB).
The toast "Attachment upload blocked due to size limit" appears — correct.
Within ~3 seconds, click channel B in the channel list.
The same toast appears again in channel B, which has no attachment and no upload in progress.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Package version

stream-chat-react: 14.12.0
stream-chat-css: 5.16.1
stream-chat-js: 9.52.0

Lingua principale
TypeScript
Stelle
845
Fork
297
Merge medio
1g 3h
PR unite (30g)
24

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 GetStream/stream-chat-react

Tutte le issue di GetStream/stream-chat-react

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.