Skip to content

Updated state not being replicated to new joiners to a scene #443

@diarmidmackenzie

Description

@diarmidmackenzie

I'm adding NAF support to an interactive A-Frame festive scene.

One problem I have noticed is that while entities are correctly synced between clients, when a new client joins the scene, entities that have been moved from their original positions don't get their positions updated until they are moved again.

I don't yet understand why this doesn't work.

On connection of a new client, NAF has code that will trigger a call to NAF.entities.completeSync() see code here

I've checked, and the new client connection is being detected, this code is being executed, and yet the entity positions aren't getting updated on the new client.

I have implemented a workaround, which is simply to make another call to completeSync() (this time with isFirstSync set to false) on detection of the clientConnected event.

This workaround is working fine for me, so I don't have a problem any more. But it seems like the existing NAF mechanism should have been adequate, and for some reason it wasn't.

I can re-construct the issue if someone wants to look into this. I don't think I'll be able to prioritize looking into this further in the short term, as I have a viable workaround in place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions