Page MenuHomePhorge

Exception when viewing incoming Chat room messages, when not in Participants
Closed, ResolvedPublic

Description

When I go to a public Conpherence room, there will sometimes pop up following modal:

image.png (167×969 px, 6 KB)

Stack trace:

arcanist(head=arcpatch-D25374, ref.master=df6c315ace5f, ref.arcpatch-D25374=120a37eb278d), phorge(head=master, ref.master=0ef08baf6452)
   #0 <#2> PhutilErrorHandler::handleError(integer, string, string, integer, array) called at [<phorge>/src/applications/conpherence/storage/ConpherenceThread.php:91]
   #1 <#2> ConpherenceThread::getParticipant(string) called at [<phorge>/src/applications/conpherence/controller/ConpherenceUpdateController.php:331]
   #2 <#2> ConpherenceUpdateController::loadAndRenderUpdates(string, string, integer) called at [<phorge>/src/applications/conpherence/controller/ConpherenceUpdateController.php:147]
   #3 <#2> ConpherenceUpdateController::handleRequest(AphrontRequest) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:284]
   #4 phlog(RuntimeException) called at [<phorge>/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php:41]
   #5 PhabricatorDefaultRequestExceptionHandler::handleRequestThrowable(AphrontRequest, RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:751]
   #6 AphrontApplicationConfiguration::handleThrowable(RuntimeException) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:296]
   #7 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phorge>/src/aphront/configuration/AphrontApplicationConfiguration.php:204]
   #8 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phorge>/webroot/index.php:35]

The phid is my user phid.

Steps to reproduce

  • Have Aphlict enabled and working
  • Be user Alice and visit a Conference Room without Alice in participants list
  • Be user Bob and send a message in that Conference Room

→ Crash from the tab of Alice

This is fixed when Alice joins the room or she sends a message (since it auto-joins the room).

Event Timeline

valerio.bozzolan updated the task description. (Show Details)

This happened some minutes ago to our friend @waldyrious and I was able to reproduce it on my local computer. I've attached my reproducing instructions.

Locally, I was able to fix with this patch:

diff --git a/src/applications/conpherence/controller/ConpherenceUpdateController.php b/src/applications/conpherence/controller/ConpherenceUpdateController.php
index a792a5a4d4..15e1f794a3 100644
--- a/src/applications/conpherence/controller/ConpherenceUpdateController.php
+++ b/src/applications/conpherence/controller/ConpherenceUpdateController.php
@@ -328,7 +328,7 @@ final class ConpherenceUpdateController
       ->executeOne();

     $non_update = false;
-    $participant = $conpherence->getParticipant($user->getPHID());
+    $participant = $conpherence->getParticipantIfExists($user->getPHID());

     if ($need_transactions && $conpherence->getTransactions()) {
       $data = ConpherenceTransactionRenderer::renderTransactions(
@@ -336,7 +336,7 @@ final class ConpherenceUpdateController
         $conpherence);
       $key = PhabricatorConpherenceColumnMinimizeSetting::SETTINGKEY;
       $minimized = $user->getUserSetting($key);
-      if (!$minimized) {
+      if (!$minimized && $participant) {
         $participant->markUpToDate($conpherence);
       }
     } else if ($need_transactions) {

So the first change fixes the problem,

and the second change fixes a follow-up problem (a NULL pointer, since there is not participant, so we cannot $participant->markUpToDate()) and with this it just works as expected to me

valerio.bozzolan renamed this task from Exception when opening room to Exception when viewing incoming Chat room messages, when not in Participants.Aug 18 2023, 08:52
valerio.bozzolan updated the task description. (Show Details)

Hi @bekay, feel free to look at D25408. It should fix your original problem. Thanks for your reporting