Issue with Fluid Audience Service
Describe the bug
We are facing an intermittent issue where the Audience API returns single user with id as null/undefined This usually happens will certain time when all the collaborators have left the sesssion When we query the cache directly we do not get any users there.
To Reproduce
Steps to reproduce the behavior: It is intermittent
- Start a collaborative session
- Add some more collaborators
- Let all the collaborators leave
- Connect to container to fetch the audience
- You would get 1 user and id is null/undefined
Expected behavior
Ideally it should return zero users but if it still is returning 1 user for certain time then it should return with proper id
@arafat-java, what version of FluidFramework client are you using and which service (azure-client, odsp-client, or custom)?
We are presently using server_v5.0.0 and the issue is coming when using the azure-client
We intend to upgrade to server_v6.0.0 soon
@arafat-java, and what version of azure-client?
To make sure we are looking for the same bad result, you are saying that if you had code like:
const audienceMembers = services.audience.getMembers();
for (const [id, member] of audienceMembers.entries()) {
console.log(`Member '${id}' is present with id '${member.id}'.`);
}
the result would be:
Member 'null' is present with id 'null'
or maybe member is undefined?
It would be
Member 'undefined' is present with id 'undefined'.
Hello, I'm attempting repro the issue here!
Ideally it should return zero users...
Why do you say you're expecting zero users in audience? When you say "4. Connect to container to fetch the audience", I assume you would expect 'self' to be in audience as well, right?
My bad, should have been explicit Ideally I was expecting zero users apart from myself. But there is one and that is causing the 'undefined' issue
Thanks for the detail. I contacted the server team and this issue should be fixed by upgrading to server_v6.0.0 (was addressed with this fix https://github.com/microsoft/FluidFramework/pull/20329).
Try upgrading to 6.0.0 and see if the issue persists.
Hi @arafat-java ! Just want to follow up here to see if the server bump helped resolve the issue.
@WillieHabi We've faced certain roadblocks in server version upgrade. Should be done in a week or so. Will check and update here post that
@WillieHabi We updated our server to v6.0.0 but it is still the same. Getting the exact same error Can you please check
That's unfortunate to hear -- will be contacting the server team again and attempt to reproduce the issue against server v6.0.0.
Can you say what version of Fluid client (azure-client) you are using?
And if possible could you provide code snippet of specific API that are returning audience members with undefined id's.
@fluidframework/azure-client "2.0.0-rc.1.0.9"
The code snippet is as follows
export function getCollaboratingUsersAzure(
containerInfo: ContainerInfo,
excludeUser?: string
): AzureMember[] {
verifyConnectedState(containerInfo, "getCollaboratingUsersAzure");
const services = containerInfo.services;
if (!services) {
return [];
}
const users: AzureMember[] = [];
const members = services.audience.getMembers();
members.forEach((member, key) => {
if (!excludeUser || key !== excludeUser) {
users.push(member);
}
});
return users;
}
Thanks for confirming the version and the relevant code snippet. We however no longer support rc versions, including 2.0.0-rc.1.0.9. Our current support window is for the 2.x line with full support starting at 2.53+. Are there any blockers preventing you from moving to 2.0+? This will ensure you're using a fully supported azure-client version.
@WillieHabi we tried using 2.52.0 but still have this issue
@WillieHabi Any updates on this
Looking into this again. Can you confirm that you are seeing the same exact issue (i.e. returning undefined user id's)? I question this because in 2.52.0 we assert that AzureUser.id is defined. Is there now a TypeError being thrown when performing audience.getMembers()?