Upload error toast for a rejected presentation can't be dismissed and keeps reappearing
Describe the bug
When bbb-web rejects an upload for exceeding maxNumPages, the presenter sees the upload-error toast. Closing it doesn't stick: the toast comes back on later re-renders for the rest of the meeting. Reloading the page doesn't help, because the flag the client checks is stored on the server. Only ending the meeting clears it.
Cause, from the code on v3.0.x-release (also present on v4.0.x-release):
- The toast lists every
pres_presentationrow whereuploadCompletionNotified = false(presentation-uploader-toast/container.jsx). - Closing the toast sends
presentationSetUploadCompletionNotified.SetPresentationRenderedInToastPubMsgHdlrupdates the row only ifPresentationPodsApp.presentationBelongsToMeeting(state, presentationId)is true, which checks the in-memory pod state. - A rejected upload is never added to the pod state.
PresentationConversionUpdatePubMsgHdlrwrites only the DB row, andPresentationPageCountErrorPubMsgHdlrdoespres <- pod.getPresentation(id), getsNone, and leaves the state unchanged. It still writesuploadErrorMsgKeyto the DB throughPresPresentationDAO.updateErrors. - So
presentationBelongsToMeetingis false for the rejected presentation, the notified flag is never set, and the row stays in the toast list.allPresentationsDoneis false while that row exists, so the toast's effect setsshowToastback to true on the next render.
PresentationUploadedFileTimeoutErrorPubMsgHdlr, PresentationUploadedFileVirusErrorPubMsgHdlr, PresentationUploadedFileScanFailedPubMsgHdlr and PdfConversionInvalidErrorSysPubMsgHdlr use the same pod.getPresentation(id) pattern, so the same thing probably happens whenever any of those errors arrive before the first page starts converting. Not verified for those paths.
To Reproduce Seen in production. Not yet reproduced in a lab.
- As presenter, upload a PDF with more pages than
maxNumPages. - Wait for the "exceeds the maximum number of pages" error in the upload toast.
- Close the toast, or clear the error in the upload dialog.
- Trigger a client re-render, for example another participant starting a webcam.
- The upload-error toast reappears.
Expected behavior Once the presenter dismisses the error, it stays dismissed.
Actual behavior The error toast keeps reappearing for the presenter for the rest of the meeting.
Evidence from the production meeting
- bbb-web logged
num_pages_exceededfor two uploads (288 and 299 pages,maxNumPages=256). The presenter then uploaded shorter versions, which converted normally. - In akka, the IDs of the rejected presentations appear only in
PresentationConversionRequestReceivedSysMsg,PresentationConversionUpdateSysPubMsgandPresentationPageCountError{Sys,Evt}Msg, all within about one second. There is noPresentationPageConversionStartedSysMsg, the handler that adds a presentation to the pod state. - About two and a half hours later, the customer reported that the errors were still reappearing whenever someone turned on a camera. The link to webcam start comes from that user report. We have not isolated which re-render triggers it.
Possible fix
Either let SetPresentationUploadCompletionNotified update rows that exist only in the DB (scoped by meetingId, which the DAO update already filters on), or have the error handlers add the errored presentation to the pod state when getPresentation returns None. The first is smaller. The existing permission check in the handler would still apply.
Server BBB 3.0: bbb-apps-akka 3.0-399, bbb-html5 build 1679. Presenter browser unknown.
Source: bigbluebutton/bigbluebutton