Closed drkno closed 8 years ago
Ahh... Good old js falsy values... Empty string is counting as false and so userData.name is getting evaluated.. We can probably change that null coalescing operator into some inline conditional like threadData.name != null ? threadData.name : userData.name
or any similar variation.
I expect this will happen in any group chat that is not explicitly named.
Same issue here :) Do you plan to release a fix soon?
I'm out of town. @bsansouci Ben can you fix this?
This issue is not completely solved: the tests still expect the name to be a non-empty string but ""
is a legal value.
// current:
assert(info.name != null && info.name.length > 0);
// fixed:
assert(info.name != null);
Oh good catch!
On one chat (one only, all others work fine) when I call
api.getThreadInfo
, this error is thrown:I logged the contents of both
threadData
anduserData
before that line:threadData
userData
The code that is calling the method is simply passing the
event.threadID
property:(The rest of the code is here).
The version of the API that is being used is
1.1.0
.