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

Disallow saving a non-opened project #2225

Merged
merged 21 commits into from
Mar 23, 2021

Conversation

odeimaiz
Copy link
Member

@odeimaiz odeimaiz commented Mar 22, 2021

What do these changes do?

When a user forgets a project opened in a laptop, or takes a plane. the project gets disconnected after 15 minutes.
In case he reconnects, the project would save again without being opened in the backend. This cannot be tolerated.

Solution:
when the connect/reconnect event happens in the webscoket, the frontend asks for the active study. If the backend already closed the study, it will return a null. In that case the frontend brings the user back to the dashboard.

Related issue/s

related to ITISFoundation/osparc-issues#435

How to test

Checklist

@odeimaiz odeimaiz changed the title Fix/active study reconnect Disallow saving a non-opened project Mar 22, 2021
@codecov
Copy link

codecov bot commented Mar 22, 2021

Codecov Report

Merging #2225 (8d769b7) into master (dc5cf7c) will decrease coverage by 0.0%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #2225     +/-   ##
========================================
- Coverage    73.0%   72.9%   -0.1%     
========================================
  Files         465     465             
  Lines       17983   17983             
  Branches     1773    1773             
========================================
- Hits        13133   13124      -9     
- Misses       4381    4387      +6     
- Partials      469     472      +3     
Flag Coverage Δ
integrationtests 65.3% <ø> (-0.2%) ⬇️
unittests 66.4% <ø> (+<0.1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...webserver/computation_comp_tasks_listening_task.py 84.9% <0.0%> (-6.5%) ⬇️
...ce_webserver/resource_manager/garbage_collector.py 74.8% <0.0%> (-1.0%) ⬇️
...erver/src/simcore_service_webserver/director_v2.py 85.0% <0.0%> (-0.9%) ⬇️

@odeimaiz odeimaiz requested a review from sanderegg March 22, 2021 10:35
@odeimaiz odeimaiz self-assigned this Mar 22, 2021
@odeimaiz odeimaiz added the a:frontend issue affecting the front-end (area group) label Mar 22, 2021
@odeimaiz odeimaiz added this to the The Red Panda milestone Mar 22, 2021
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

Cool. Maybe a short message telling the user he was disconnected for too long might come in nicely?

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

Shouldn't we add a condition on the backend API such that a study can only be modified if it is first active (i.e. opened) ?

@odeimaiz
Copy link
Member Author

odeimaiz commented Mar 22, 2021

Shouldn't we add a condition on the backend API such that a study can only be modified if it is first active (i.e. opened) ?

The problem is that at the moment the frontend can't patch a specific field in the study, so every modification in the study itself goes through the put call providing the whole serialized study in the body, not only the workbench changes.... (that's why the very first solution from Friday was discarded).
This means that, right now, you should be able to update a study (e.g. add a classifier) even if it's not open.

@odeimaiz odeimaiz added the bug buggy, it does not work as expected label Mar 22, 2021
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

I see, we'll have to provide a better solution for the future.

@odeimaiz odeimaiz merged commit 34ea984 into ITISFoundation:master Mar 23, 2021
@odeimaiz odeimaiz deleted the fix/active-study-reconnect branch August 23, 2021 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:frontend issue affecting the front-end (area group) bug buggy, it does not work as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants