OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

[Bug]: The file editor is displaying the wrong content.

Open Shimada666 opened this issue 1 year ago • 3 comments

Is there an existing issue for the same bug?

  • [X] I have checked the troubleshooting document at https://opendevin.github.io/OpenDevin/modules/usage/troubleshooting
  • [X] I have checked the existing issues.

Describe the bug

After clicking refresh icon, the displayed file content becomes incorrect. However, upon inspecting using F12, the data returned from the backend is correct. I will debug and fix this issue later.

https://github.com/OpenDevin/OpenDevin/assets/33391300/073eb607-a8ec-428f-9232-c9912c0ef2a0

Current Version

main

Installation and Configuration

npm run start

Model and Agent

No response

Reproduction Steps

No response

Logs, Errors, Screenshots, and Additional Context

No response

Shimada666 avatar May 19 '24 10:05 Shimada666

How to reproduce:

  1. Create files named aaa.sh and tmp/bbb.sh.
  2. First, view the aaa.sh file, then view the tmp/bbb.sh file, and finally re-visit the aaa.sh file. You will notice that the content is incorrect.

I can confirm it's a redux issue because when I store the code using useState, the bug fixed. Later, I will see if I can refactor it.

Shimada666 avatar May 19 '24 10:05 Shimada666

Working fine here. That sh file should be inside the tree. How it replaced the workspace title?

image

SmartManoj avatar May 19 '24 12:05 SmartManoj

@SmartManoj You need to create aaa.sh and tmp/bbb.sh. Please note that bbb.sh is inside the tmp folder, and then you can reproduce it. I provide a video.

https://github.com/OpenDevin/OpenDevin/assets/33391300/9fb8e750-fe36-42ea-960f-663416e04b88

Shimada666 avatar May 19 '24 14:05 Shimada666

I had some similar issues

PierrunoYT avatar May 19 '24 20:05 PierrunoYT

@Shimada666 Yes, affecting in latest versions even without nested dirs. If two files are there a and b, The first time clicking a -> works clicking b -> works then clicking again doesn't work

SmartManoj avatar May 20 '24 04:05 SmartManoj

This PR #1853 introduced this? Workaround: View files in IDE

SmartManoj avatar May 20 '24 05:05 SmartManoj

It may be related to how the active file path is being updated. I can't do it today, so maybe you can take a look somewhere here?

https://github.com/OpenDevin/OpenDevin/blob/3e3dcd52a8043f47b747dc8560d95cf59bc8915b/frontend/src/components/file-explorer/TreeNode.tsx#L45-L69

amanape avatar May 20 '24 07:05 amanape

@SmartManoj @amanape The latest the code does not seem to have this issue, I will close this issue. Thank you all!

Shimada666 avatar May 23 '24 01:05 Shimada666