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

"The session could not be started" and "A session is already running" shown at once if auto-start with non-existing branch #1777

Closed
volodymyrss opened this issue Apr 6, 2022 · 7 comments · Fixed by #2141
Assignees
Labels
Milestone

Comments

@volodymyrss
Copy link

Description

When opening this:

https://renkulab.io/projects/astronomy/mmoda/mmoda-request/sessions/new?autostart=1&branch=mmoda_branch

image

The session which opens with "Open" button below is with master - so not at all what was intended.

Reproduce

Open this:

https://renkulab.io/projects/astronomy/mmoda/mmoda-request/sessions/new?autostart=1&branch=mmoda_branch

Context

@volodymyrss volodymyrss added the bug label Apr 6, 2022
@lorenzo-cavazzi
Copy link
Member

Thank you @volodymyrss for the feedback. The message is indeed confusing in this case.

When using an autostart link to quickly create a new session, we verify that any embedded data is valid.
In this case, since the branch doesn't exist, we show the warning message and we select the default branch for the project.
It seems you already had a running session on the default branch, this is why you are getting the second message. It's a somewhat unexpected combination, and I see how this is confusing.

Do you think adding a longer explanation in the first message would help? Something like the following:

The session could not be started using the quickstart link because it was not possible to find a valid branch or commit as specified in the embedded data.
We selected the default values instead. You can verify and change them by expanding the options to select branch and commit.

@volodymyrss
Copy link
Author

volodymyrss commented Apr 7, 2022

Thank you @volodymyrss for the feedback. The message is indeed confusing in this case.
Do you think adding a longer explanation in the first message would help? Something like the following:

The session could not be started using the quickstart link because it was not possible to find a valid branch or commit as specified in the embedded data.
We selected the default values instead. You can verify and change them by expanding the options to select branch and commit.

I see the logic, but the result is a bit unexpected indeed.
In principle, what would be natural for me is probably even more than warning, but an error of some sort.
Starting session with branch is potentially quite a different thing, and while default branch is a reasonable fall-back, it should be exceedingly clear the fallback is selected.
Maybe a warning is enough, it's up to you.

@ciyer
Copy link
Contributor

ciyer commented Apr 8, 2022

I can imagine contexts where an error would be the right thing to do, but given the many different ways these links can be used and passed around, I would prefer to leave it as a warning, as an error might be too discouraging to some of our users. :)

I suggest showing a warning with the following information:

A session on the branch [name of branch] could not be started because this branch does not exist.
The branch has been set to the head of [default branch], and this can changed by [expanding the options](link to expand options).

A version of this message will need to be made for the case that the commit could not be found, but I am assuming it is obvious how it would be adapted.

This doesn't completely handle the additional complication of what to do when a session is already running against the default branch, but I think this will help at least a little in that case as well.

@volodymyrss
Copy link
Author

I can imagine contexts where an error would be the right thing to do, but given the many different ways these links can be used and passed around, I would prefer to leave it as a warning, as an error might be too discouraging to some of our users. :)

True. But to share my particular experience, it was quite discouraging to open session which I assumed had my branch, but the content was missing.

I suggest showing a warning with the following information:

A session on the branch [name of branch] could not be started because this branch does not exist.
The branch has been set to the head of [default branch], and this can changed by [expanding the options](link to expand options).

A version of this message will need to be made for the case that the commit could not be found, but I am assuming it is obvious how it would be adapted.

This doesn't completely handle the additional complication of what to do when a session is already running against the default branch, but I think this will help at least a little in that case as well.

Actually when there is no session, the message is already quite understandable - for me.
But the problem was indeed exactly with combination of "can not start session" and "a session is running" without something sufficiently obvious (for me) that what is running is not what I want.

@lorenzo-cavazzi
Copy link
Member

The branch has been set to the head of [default branch], and this can changed by [expanding the options](link to expand options).

@ciyer Minor detail to keep in mind: it may not be the head commit. Autosaves take precedence (if any), and running sessions also take precedence (if any) -- the priority is commit@running_session > commit@autosave > commit@head

@ciyer
Copy link
Contributor

ciyer commented Apr 19, 2022

We will tackle this in the next sprint and provide understandable feedback when a user tries to autostart a session and the internal logic redirects them to an already existing session.

@lorenzo-cavazzi
Copy link
Member

In the meanwhile, the "Start session" page changed a bit. Here is the current output for such a case.

Image

It's probably less confusing since we now show all the options when an error occurs, but the message is still confusing.
Starting from the previous suggestion from Sekhar, we can modify the message as follows and see how it works:

A session for the reference [name of branch or commit] could not be started because it does not exist in the repository.
The branch has been set to the default [default branch]. You can change that and other options down below.

I adapted it to the current output (options already expanded) and made it a bit more generic so that we can handle branches and commits in the same way

@andre-code andre-code moved this from Todo to In Progress 🧑‍💻 in UI Sprints - DEPRECATED Nov 14, 2022
@andre-code andre-code moved this from In Progress 🧑‍💻 to Review 🔎 in UI Sprints - DEPRECATED Nov 15, 2022
Repository owner moved this from Review 🔎 to Done ✅ in UI Sprints - DEPRECATED Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants