FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Issue with Fluid Audience Service

Open arafat-java opened this issue 6 months ago • 17 comments

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

  1. Start a collaborative session
  2. Add some more collaborators
  3. Let all the collaborators leave
  4. Connect to container to fetch the audience
  5. 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 avatar Jul 09 '25 04:07 arafat-java

@arafat-java, what version of FluidFramework client are you using and which service (azure-client, odsp-client, or custom)?

jason-ha avatar Jul 09 '25 17:07 jason-ha

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 avatar Jul 10 '25 05:07 arafat-java

@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?

jason-ha avatar Jul 11 '25 21:07 jason-ha

It would be Member 'undefined' is present with id 'undefined'.

arafat-java avatar Jul 16 '25 17:07 arafat-java

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?

WillieHabi avatar Jul 16 '25 21:07 WillieHabi

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

arafat-java avatar Jul 17 '25 07:07 arafat-java

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.

WillieHabi avatar Jul 22 '25 17:07 WillieHabi

Hi @arafat-java ! Just want to follow up here to see if the server bump helped resolve the issue.

WillieHabi avatar Aug 05 '25 19:08 WillieHabi

@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

arafat-java avatar Aug 06 '25 00:08 arafat-java

@WillieHabi We updated our server to v6.0.0 but it is still the same. Getting the exact same error Can you please check

arafat-java avatar Sep 05 '25 04:09 arafat-java

That's unfortunate to hear -- will be contacting the server team again and attempt to reproduce the issue against server v6.0.0.

WillieHabi avatar Sep 08 '25 17:09 WillieHabi

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.

WillieHabi avatar Sep 08 '25 21:09 WillieHabi

@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;
}

arafat-java avatar Sep 11 '25 10:09 arafat-java

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 avatar Sep 11 '25 17:09 WillieHabi

@WillieHabi we tried using 2.52.0 but still have this issue

arafat-java avatar Sep 29 '25 15:09 arafat-java

@WillieHabi Any updates on this

arafat-java avatar Oct 06 '25 05:10 arafat-java

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()?

WillieHabi avatar Oct 06 '25 16:10 WillieHabi