Note - As of 2025, this bug is fixed
Introduction
I tried to schedule a meeting in MS Teams v2 using the Scheduling Assistant and it crashed
Note - Press the play button if the video does not load automatically. If you still face issues, you can view it here
It seemed like a one off bug or an issue with the VPN, but after some investigation, it was something else. Funnily enough, the bug is only in the scheduling assistant and not the normal meeting details screen.
The same bug is present on the desktop version of MS Teams (probably coz they use the same codebase)
So…why does MS Teams error out when I type in Jay and nothing else?
Approach 1
Lets dig into it a bit more, and we start at the console
Press the play button if the video does not load automatically. If you still face issues, you can view it here
We see an error in the console thats…an empty object? {}? That’s not very descriptive. But lets look at the callstack and set some breakpoints

After some debugging, I found that this is the last statement before the page errors out

Roadblock 1
Perhaps its the setState() ? Its not. We can step through the code to arrive at the setState function and then evaluate the expression in the Chrome Console

That works…what now? I then spent the next hour going through minified Js code and…its not an issue with the library (pretty obvious huh). But the code did error out during the render process, which was interesting
If its not this code that errors out, what does? That’s an interesting question
Approach 2
Maybe its an issue with the data? That’s pretty unlikely…right? The system works. In fact, there have been no major issues till date with the Microsoft ecosystem.
Spoiler alert - its complicated
After a lot of debugging, I noticed that our last user in the list was problematic, and if we modify the variable e in place when the breakpoint is active, the error is not visible anymore.
So searching for a user Jay isn’t what is causing Teams to crash, but the properties associated with that user is what is causing the error.
Cool, thats progress. But why does that happen
What’s causing the error
After some more debugging, I found out that the user property userType is what is causing the error. More specifically, its
userType = 'Guest'

That kind of makes sense…kind of. I think I have a good idea of whats going on
If you look at one of these Guest users,

I’m going to make an educated guess and I probably am wrong
Users having userType = 'Guest' do not have working hours and/or someone to report to. So its possible that the Scheduling Assistant page errors out when trying to display their free times and stuff
That kinda makes senes and the fix works too

In the screenshot above, we slice the array to remove the last Guest user and keep the second last Guest user. We then change their userType to Member and stuff seems to work
Microsoft, please fix this 😂 Maybe now someone will believe me when I tell them that Teams isn’t letting me schedule a meeting so I can’t work
that was a joke