Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve workspace lock error dialog. #2347

Merged

Conversation

raghucssit
Copy link
Contributor

Write workspace lock info like user, host, java process id, display properties onto .lock file if the lock was successful. Read the current lock data in case of lock was unsuccessful and shown it in error dialog.
If the .lock file has no info then nothing is shown. For older eclipse versions.

see #2343

@raghucssit
Copy link
Contributor Author

@iloveeclipse FYI

@BeckerWdf
Copy link
Contributor

Can you pls. provide a screenshot showing the new dialog?

@laeubi
Copy link
Contributor

laeubi commented Oct 1, 2024

By the way if on the lock dialog is worked, it would be great to have a cancel button!

Currently one can only Retry or Choose where on the second one can then finally cancel the startup of Eclipse. Instead I have most of the time not the case that another user locked the workspace but I have just an instance already running. In that case a early Cancel would be great.

@raghucssit
Copy link
Contributor Author

Can you pls. provide a screenshot showing the new dialog?

Dialog looks like this with this fix.
image

Copy link
Contributor

github-actions bot commented Oct 1, 2024

Test Results

 1 818 files  +  3   1 818 suites  +3   1h 33m 2s ⏱️ + 8m 40s
 7 709 tests + 45   7 481 ✅ +155  228 💤 ± 0  0 ❌  - 1 
24 288 runs  +128  23 541 ✅ +441  747 💤 +22  0 ❌  - 1 

Results for commit 03c222e. ± Comparison against base commit 1eead54.

♻️ This comment has been updated with latest results.

@BeckerWdf
Copy link
Contributor

Can you pls. provide a screenshot showing the new dialog?

Dialog looks like this with this fix. image

Maybe User, Host, etc. should be written in with an uppercase first letter (because they are some kind of label)

@tomaswolf
Copy link
Member

And these display strings must be localizeable.

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately it looks like writing to the locked file unlocks it again!

I'm able to start multiple Eclipse instances on same workspace now :-(

@raghucssit
Copy link
Contributor Author

Fixed all the review comments. Committed as separate commit to help the review.
Later I will squash them as single commit.

@raghucssit
Copy link
Contributor Author

Unfortunately it looks like writing to the locked file unlocks it again!

I'm able to start multiple Eclipse instances on same workspace now :-(

I have changed the approach now.
First we will check if the workspace is locked, If not then write the data who is going to lock it.(Also backup .lock file data)
Now initiate actual lock, If we are successful all good Otherwise write back what was there before onto .lock file.

@iloveeclipse
Copy link
Member

Also please rebase on latest master before next push

@raghucssit
Copy link
Contributor Author

Also please rebase on latest master before next push

I went through comments. I will refactor the code with .loc_info file approach. which will not have any risks. If file exists we show owner info otherwise old error dialog.

@raghucssit raghucssit force-pushed the impr_ws_lock_dlg_2343 branch 6 times, most recently from f8f7892 to 1c35e4f Compare October 9, 2024 14:11
@raghucssit
Copy link
Contributor Author

By the way if on the lock dialog is worked, it would be great to have a cancel button!

Currently one can only Retry or Choose where on the second one can then finally cancel the startup of Eclipse. Instead I have most of the time not the case that another user locked the workspace but I have just an instance already running. In that case a early Cancel would be great.

I will do this change as separate PR. As we are only improving error message here. Other suggestions are fixed.

@raghucssit
Copy link
Contributor Author

All the review suggestions are fixed.

@BeckerWdf
Copy link
Contributor

All the review suggestions are fixed.

How does the UI look now?

@raghucssit
Copy link
Contributor Author

All the review suggestions are fixed.

How does the UI look now?

Now it looks like this.
image

@laeubi
Copy link
Contributor

laeubi commented Oct 10, 2024

Now it looks like this.

The labels are still not aligned, it should be something like

User:    abcd
Host:    234.567.7
Display: :1

@BeckerWdf
Copy link
Contributor

Display: :1

Especially this looks strange because of the two ":". I knot that's they displays are called. Maybe we should put all the values into single or double quotes. So that is would look like

User:    "abcd"
Host:    "234.567.7"
Display: ":1"

@laeubi
Copy link
Contributor

laeubi commented Oct 10, 2024

Especially this looks strange because of the two ":". I knot that's they displays are called.

Display has format <hostname>:<sequence number>.<screen number> so the format can potentially be longer.

@BeckerWdf
Copy link
Contributor

Especially this looks strange because of the two ":". I knot that's they displays are called.

Display has format <hostname>:<sequence number>.<screen number> so the format can potentially be longer.

Sure. But this does not contradict my proposal...

@raghucssit
Copy link
Contributor Author

Especially this looks strange because of the two ":". I knot that's they displays are called.

Display has format <hostname>:<sequence number>.<screen number> so the format can potentially be longer.

I am using System.getenv("DISPLAY"); to read display number. I use 2 monitors it always returns value as shown above. like :1 for vnc display 1.

@raghucssit raghucssit force-pushed the impr_ws_lock_dlg_2343 branch 2 times, most recently from 9f3f9a9 to 987ceca Compare October 13, 2024 20:54
@raghucssit
Copy link
Contributor Author

Display: :1

Especially this looks strange because of the two ":". I knot that's they displays are called. Maybe we should put all the values into single or double quotes. So that is would look like

User:    "abcd"
Host:    "234.567.7"
Display: ":1"

I have introduced tab spacing and single quotes for the lock owner details. Now the dialog looks like this.
image

@BeckerWdf
Copy link
Contributor

I have introduced tab spacing and single quotes for the lock owner details. Now the dialog looks like this.

That looks nice now. Thanks

@laeubi
Copy link
Contributor

laeubi commented Oct 14, 2024

@BeckerWdf do you think the quotes are required with the new layout? They look a bit misplaced from my point of view.

@merks
Copy link
Contributor

merks commented Oct 14, 2024

@BeckerWdf do you think the quotes are required with the new layout? They look a bit misplaced from my point of view.

Yes, unless one expects there might be trailing or leading whitespace that needs to be called out because that relevant, then the quotes seem like merely noise. And I believe in this case there is no interesting whitespace.

@BeckerWdf
Copy link
Contributor

Yes. In the new layout we can get rid of them from my point of view.

Write workspace lock info like user, host, java process id, display
properties onto a new file .lock_info if the lock was successful.
Read the current lock data in case of lock was unsuccessful and show it
in error dialog.
If the .lock_info does not exist or the file has no info then nothing is
shown. For older eclipse versions.

see eclipse-platform#2343
@raghucssit
Copy link
Contributor Author

Fixed review comments. Now dialog looks like this.
image

Copy link
Member

@iloveeclipse iloveeclipse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Raghu! Looks good now.

private File createLockInfoFile(URL workspaceUrl) throws Exception {
File lockInfoFile = getLockInfoFile(workspaceUrl);

if (lockInfoFile.exists())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Next time please don't forget to put "if" in a block.

@iloveeclipse iloveeclipse merged commit 52d1a35 into eclipse-platform:master Oct 15, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants