Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.13k stars 1.41k forks source link

[Intermittent] Moving endlessly after using text input inside room #5385

Open markusTraber opened 2 years ago

markusTraber commented 2 years ago

Description Some users and I experienced moving endlessly (sideways?!) after using a text input, e.g. chat, and switching back focus to the 3D Space.

To Reproduce Unfortunately I cannot reliably reproduce this issue, so the following steps do not necessarily let you reproduce the issue.

  1. Go to into a room.
  2. Utilize the chat.
  3. Switch back to the 3D Space (remove focus from text input).
  4. The avatar moves endlessly without any keys being pressed.

Expected behavior The avatar should not move without pressing the according keys.

Hardware

Additional context @rawnsley suggested on Discord (https://discord.com/channels/498741086295031808/535606666708910101/968076414060466177) that it might have sth. to do with the switch of focus.

cornelionce commented 2 years ago

I was unable to reproduce this issue on macOS 11.6. I've tried using latest Firefox, Chrome and Safari browsers based on the provided steps to reproduce.

As a side note, I've tested by changing the focus from the input field using the macbook touchpad and also with a mouse.

@markusTraber, how ofter does this happen on your side?

rawnsley commented 2 years ago

I only have anecdotal data to add: I've seen this problem several times over the last couple of years on Chrome on the MacBook. I don't have a reliable reproduce, but it happens due to some combination of typing into chat and focus change, either within the window or between windows (unclear which). I'm pretty sure I've heard it confirmed by the Hubs team and I thought there was a GitHub issue raised already but I couldn't find one.

The last time it happened was about a month ago. After typing a chat message my avatar started strafing left continuously and didn't stop for a few minutes. My assumption is that the 'a' key somehow got flagged in key-down mode, but the key-up event was never received. My best guess is that it something to do with the 3D canvas context and the browser 2D context.

markusTraber commented 2 years ago

It only happens very infrequently, I think over the time of one year I only experienced it 5-6 times.

I also edited my initial post and removed Firefox: I assumed that I was using Firefox, but I am actually not sure.

The last user, that has reported this issue to me, was definetely using Chrome. The user did report later on, that she did not use the chat, but did have Whatsapp open in one Tab and was switching between Hubs and Whatsapp. I am going to test something similar.

markusTraber commented 2 years ago

Alright today I managed to reproduce it by accident while testing out code for my custom Hubs client.

Browser: Firefox Developer Edition 101.0b2 OS: macOS Monterey 12.3.1 Hardware: Macbook Pro 16 2021 (M1Max)

What I did:

Here is a screenshot of the dialog: grafik

Now that I changed focus to another browser in order to write this bug report for a few minutes, I am not moving to the left anymore.

I did try it this way again, but now it does not happen anymore.

emclaren commented 2 years ago

I couldn't reproduce this either.

If anyone can figure out how to reproduce this issue please let us know. It happens to me as well, but I can't figure out how to reproduce/test it.

I'm flagging as a p3 because its hard to troubleshoot without knowing how to reproduce, but will escalate if we figure out what is triggering this to happen. Thanks everyone