Yellow-Dog-Man / Resonite-Issues

Issue repository for Resonite.
https://resonite.com
111 stars 0 forks source link

When dropping a null value from and into a Text Field it sets the field to a "Random" value #2046

Open LeCloutPanda opened 2 weeks ago

LeCloutPanda commented 2 weeks ago

Describe the bug?

When trying to grab and release a null value in TextFields sets the Text to a seemingly "random" value.

From what I gathered when trying to pull a value from text fields it grabs the item you are pulling from as well and the code just iterates over all the available values stored on the object and just sets the text to be what ever was last on that list.

To Reproduce

There are a few ways to do it. 1) Open your chat with someone in game and spam grab and release on the message box(Don't click it and it must be null so it should say "Write a message...")

2) Some TextFields on items also do it at random too, I tested it with Gabriel192s open print as it has a field to put a name in(Shown in the video below) and it's the same steps so just "grab" the nulled field and let go and it grabs a "random" value

Expected behavior

It to not do this and just set the text to null/blank space.

Screenshots

Easily reproducable in game with the contacts tab image image

Gabriel192s OpenPrint image image

Resonite Version Number

2024.5.7.505

What Platforms does this occur on?

Windows

What headset if any do you use?

N/A

Log Files

My log file unmodded GEOFF - 2024.5.7.505 - 2024-05-17 21_10_11.log

Additional Context

Example video of what the bug is

I used a modded game to get the footage so I can use my dash as if I was in vr but this is reproducable in vanilla https://github.com/Yellow-Dog-Man/Resonite-Issues/assets/53411604/a979cb47-0473-45ea-b397-a3076fbc7dcc

My investigations

This is the decompiled code I was looking through, I was looking through the TextField class and the TryReceive method image I did a test to see changing content.Value; to Test and when I caused the bug again it set the text to Test image

Reporters

JustlyDeclarable (Discord) LeCloutPanda (Discord) Bredo (Discord) DarkeySabertooth (Discord) ErrorJan (Discord) Ocelot342 (Discord)

shiftyscales commented 1 week ago

I have occasionally observed random stuff in the message field of the contacts tab- this could explain why.

It seems that this issue does not occur at all on desktop, @LeCloutPanda? I can't reproduce the conditions you highlighted on screen mode of a vanilla copy of Resonite.

This issue otherwise seems like it should have everything it needs. Do you know with certainty if it's not possible to replicate this behaviour in desktop? E.g. could you provide a link to a replication object/world that you know definitely reproduces this issue outside of the dash?

LeCloutPanda commented 1 week ago

I have occasionally observed random stuff in the message field of the contacts tab- this could explain why.

It seems that this issue does not occur at all on desktop, @LeCloutPanda? I can't reproduce the conditions you highlighted on screen mode of a vanilla copy of Resonite.

This issue otherwise seems like it should have everything it needs. Do you know with certainty if it's not possible to replicate this behaviour in desktop? E.g. could you provide a link to a replication object/world that you know definitely reproduces this issue outside of the dash?

My theory that the contacts tab method doesn't work on desktop is that the UI is handled differently and isn't projected onto a 3D mesh that is grabbable making it so desktop users aren't able to both simultaneously grab the dash and a field value at the same time.

This isn't a VR exclusive bug, the main example I've given is VR exclusive(desktop too with a mod that enabled VR dash on desktop) but the other example I gave was also done in desktop.

Here is the Discord Thread for the device I used to show off the bug https://discord.com/channels/1040316820650991766/1176871740920561705

shiftyscales commented 1 week ago

I see. Could you please still provide a sample item that can be used to replicate this issue in desktop then, @LeCloutPanda?

LeCloutPanda commented 1 week ago

I see. Could you please still provide a sample item that can be used to replicate this issue in desktop then, @LeCloutPanda?

The tool I used to show is called the "Open Print" it can be found in gabriel192s folder, you just have to spawn it and hold right click to "grab" the value from where it says name and the let go of right click in the same place you grabbed from

resrec:///U-Gabriel192/R-8220FC6C42386FE7F097690D00ECF99B35423CCB2B6A1F47244F7EECE81732F6

shiftyscales commented 1 week ago

Would you be able to produce a simplified replication object that only has the bare minimum of what is needed to reproduce this issue, @LeCloutPanda? Doing so would help us better isolate where the problem lies specifically.

E.g. on the provided object, I can produce this issue with the "Name" field, but not the null field just beneath it- so there must be something about the way that the "Name" field in particular is set up that is causing this issue to occur.

LeCloutPanda commented 1 week ago

Would you be able to produce a simplified replication object that only has the bare minimum of what is needed to reproduce this issue, @LeCloutPanda? Doing so would help us better isolate where the problem lies specifically.

E.g. on the provided object, I can produce this issue with the "Name" field, but not the null field just beneath it- so there must be something about the way that the "Name" field in particular is set up that is causing this issue to occur.

I don't have a simplified object as one I am in bed getting ready to do some work and two the field below is for slots, the bug is for value fields not object fields so that item I have mentioned will suffice just fine and I've outlined where the bug occurs granted it's a decomp but I tested it and changing that code to say what I want gave me what I wanted back when I replicated the bug in vanilla.

LeCloutPanda commented 1 week ago

With further testing the Text Field UI preset in the official resonite folder does it too, this time it sets it to "True", to reproduce the bug open the item up in an inspector and set the text to null by clicking the null button and then grab and release the value back into it self and it'll output "True"

art0007i commented 1 week ago

I've created a video which goes into some details on why this happens and how excatly it works. it will happen both on desktop and vr since it's just how the code is written, so it could be intended but unexpected behavior in which case I still think it should be adjusted. https://www.youtube.com/watch?v=QNiVBwjSOdQ