vaticle / typedb-studio

TypeDB Studio (IDE)
https://typedb.com
Mozilla Public License 2.0
186 stars 43 forks source link

Saving query into Project folder which is a symlink breaks saving until Studio restart #710

Open izmalk opened 1 year ago

izmalk commented 1 year ago

Description

I have chosen my Project folder as /Users/vladimir/tests/IAM which happens to be a symlink to /Users/vladimir/Documents/GitHub/typedb_iam/experimental/.

Whenever I save a query it shows a yellow notice popup and then my save function doesn't work anymore until Studio restarts.

Environment

  1. TypeDB version: 2.14.3
  2. OS of TypeDB server: 12.6.3
  3. Studio version: 2.14.2
  4. OS of Studio: 12.6.3
  5. Other environment details:

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Open Studio with project folder being a symlink.1
  2. Create and save a query.
  3. Try to save another query. (with a GUI button or Cmd+S).

Expected Output

Saving dialog pops out.

Actual Output

Nothing.

Additional information

[PRJ24] TypeDB Studio Project: File has been moved to a location outside of project: /Users/vladimir/Documents/GitHub/typedb_iam/experimental/insert_record_number.tql.

Screenshot 2023-02-21 at 12 44 25

Screenshot 2023-02-21 at 12 45 40

izmalk commented 1 year ago

I just spotted that moving the Studio window from one screen to another fixed the issue. It spawns the saving dialog as soon as the main Studio window moved to another screen.

izmalk commented 1 year ago

It seems like if I don't close the saving dialog, every time I move Studio between screens there is a new saving dialog that opens on top of the previous one.

Screenshot 2023-02-21 at 14 28 47

And the following error pops up multiple times after I actually close one of them. [SYS01] TypeDB Studio System: Unexpected error occurred with a coroutine: Unknown

Screenshot 2023-02-21 at 14 23 54
izmalk commented 1 year ago

Another strange behavior in this case (with the symlink Project directory). Some files can't be renamed as it throws the following error and closes the tab with the content of the file upon hitting confirmation in the rename dialog.

[PRJ22] TypeDB Studio Project: Failed to rename file to /Users/vladimir/tests/IAM/get_filepath_with_view_access_for_kevin.tql, due to:
Collection contains no element matching the predicate.
Screenshot 2023-02-22 at 12 42 54

Screenshot 2023-02-22 at 12 41 34