QoS Report Unhandled Errors for the Week of 08/10/2020
Describe the bug
Seeing the following unhandled errors originate in this week's (08/10/2020) QoS Report. These are currently only reported for Teams Web host application
Message-1:
"Uncaught AssertionError: Unsafe to transition to read-only state!"
Associated stack:
AssertionError: Unsafe to transition to read-only state!
at _t.
Message-2:
"Uncaught AssertionError: replayPendingStates called twice for same clientId!"
Associated Stack:
AssertionError: replayPendingStates called twice for same clientId!
at Ae.replayPendingStates (https://officefluidprodversionedcdn.azureedge.net/5317403/container/officeContainer.js:155:3156)
at _t.
To Reproduce
No repro, since these are recorded through telemetry
Logs
Use the following query to look through all the error logs: union kind=outer (Office_Fluid_App_Error | where Data_eventName == "UnhandledError" or Data_eventName == "UnhandledRejection" ), (Office_Fluid_OfficeWebHost_Error | where Data_eventName == "UnhandledError" or Data_eventName == "UnhandledRejection")| where Event_Time > ago(7d) | where Data_message contains "Uncaught AssertionError: replayPendingStates called twice for same clientId!" | summarize dcount=dcount(Data_hostCorrelationId) by Data_message, Data_eventName, Data_stack, Data_hostName | order by dcount desc
Both are introduced in #2908
Another thing to look into are why these assert aren't log in the runtime and result in uncaught promise rejection and leaked into the app.
I only see 2 hits over 10 days, for either error. I believe that's the result of me adding more strict checks around when read-only transitions can happen and host eventually changing behavior.
@ruchika-m, I do not see any usage as of now of forceReadonly in bohemia repo. Can you please take a look at the history here and next steps? I.e. the asserts reflect more strict requirements around where it can be used, so any re-introduction should follow those requirements.
As for why we do not catch it: this is EventEmitter's callback, so exception propagates to the host, but they do not do anything with it. I'm adding proper logging around just that event, but not solving general problem (yet) of exceptions thrown while emitting events.
@vladsud these particular errors are only happening on Teams Web. Seems from your comment that these are stricter checks meant to make sure that the method is not used incorrectly. They also seem to be coming from old app version so maybe teams made a change to fix this on their end but let me follow up with them. Closing the issue since this doesn't look actionable on runtime's end