setObject Bug - Causes Objects to Disappear Temporarily

Hi Everyone,

This has been happening for at least a few weeks at least, but objects placed on the map will disappear temporarily if you double press x to interact. I first noticed this with go karts in my space, and I tested it with playerTriggersItem and game.setItem as well. Unfortunately, the issue exists whenever an object is removed and then placed back on the map in quick succession.

Here’s a Loom video I clipped showing the behavior: https://www.loom.com/share/09cfb28b0fa44acd9f258acb28f1d42b

When the object disappears, you cannot even press X to “reveal” it again. You must move at least a different direction in order for X to interact to work with the invisible object again.

The other odd thing I noticed is that only one object becomes invisible at a time. When another object is manipulated on the map, the invisible one will reappear. This is really jarring in our interactive games and activities because someone anywhere on the map can trigger the disappearance or reappearance of any interactable object.

Has anyone noticed this as well, and are there any fixes?
Is this potentially a known bug @npfoss?

Thanks!
Kevin

hey kevin sorry for the delay – I’m OOO next week but will take a closer look after that

I haven’t seen this but it seems like enough of an edge case that we wouldn’t normally

No worries @npfoss! Hopefully you get to enjoy some time to relax! I really appreciate you looking into this once you’re back. Thank you!

Hi @npfoss!

Hope you had a chance to enjoy the time off last week! Just wanted to see if you had any updates or insights on this. The good news is that it’s really easy to replicate because it seems to occur really consistently. Let me know if you need any logs, code examples, or anything else from me that would help your research.

Thanks!
Kevin

Sorry for the delay – just spent some time looking into this.

  1. yep just definitely a bug. Documented and detail and handed off to the codeowner. TBD on resolution timeline, it’s pretty rare outside exactly what you’re doing
  2. just FYI, also discovered a similar failure mode you might hit:
    there is a race when quickly deleting and adding objects because of momentary mismatch between the client and server state. two thoughts:
    a. this kind of issue will be much less frequent once we get our object data model in order a bit better (big project that’s medium high priority)
    b. you might be able to work around it by explicitly calling game.sendAction({ $case: "mapAddObject", mapAddObject: { mapId, object: [whatever]}) instead of setObject, when you know you want to add a new one. (I got around it by waiting 200ms before sending the setObject, so my client was updated by then)