Skip to content

feat: block after vorta create and log status#1656

Open
diivi wants to merge 7 commits intoborgbase:masterfrom
diivi:feat/block-create-and-return-status
Open

feat: block after vorta create and log status#1656
diivi wants to merge 7 commits intoborgbase:masterfrom
diivi:feat/block-create-and-return-status

Conversation

@diivi
Copy link
Copy Markdown
Contributor

@diivi diivi commented Mar 16, 2023

Description

Fixes #1380
blocks vorta --create to log the result of the backing up operation.

Motivation and Context

Better UX for vorta --create

How Has This Been Tested?

Test GIF:
create-block

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

I provide my contribution under the terms of the license of this repository and I affirm the Developer Certificate of Origin.

Comment thread src/vorta/borg/create.py Outdated
@diivi diivi marked this pull request as ready for review March 16, 2023 20:46
Copy link
Copy Markdown
Collaborator

@real-yfprojects real-yfprojects left a comment

Choose a reason for hiding this comment

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

There is a problem: A second main window opens while the backup is running.

@diivi
Copy link
Copy Markdown
Contributor Author

diivi commented Mar 17, 2023

There is a problem: A second main window opens while the backup is running.

What do you suggest I do for the second window? If I close it, will it run in the background until it exits?

@real-yfprojects
Copy link
Copy Markdown
Collaborator

What do you suggest I do for the second window?

Don't create a main window instance (nor a scheduler instance and so on).

@diivi
Copy link
Copy Markdown
Contributor Author

diivi commented Mar 17, 2023

Don't create a main window instance (nor a scheduler instance and so on).

I changed the code so it only adds the message_received event to the other instance and nothing else.

Comment thread src/vorta/application.py Outdated
Co-authored-by: yfprojects <62463991+real-yfprojects@users.noreply.github.com>
@diivi diivi requested a review from real-yfprojects March 19, 2023 10:51
Copy link
Copy Markdown
Collaborator

@real-yfprojects real-yfprojects left a comment

Choose a reason for hiding this comment

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

I notice that this can't handle when borg returns an error or when vorta --create is run twice simultaneously

Comment thread src/vorta/application.py Outdated
@diivi
Copy link
Copy Markdown
Contributor Author

diivi commented Mar 21, 2023

I notice that this can't handle when borg returns an error or when vorta --create is run twice simultaneously

My last commit should handle borg errors right?

Also, how should I handle the second case? After handling Borg errors, I get this error when I run vorta --create twice simultaneously:
QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState

@real-yfprojects
Copy link
Copy Markdown
Collaborator

After handling Borg errors, I get this error when I run vorta --create twice simultaneously:
QAbstractSocket::waitForBytesWritten() is not allowed in UnconnectedState

I see this being outputted too, but it doesn't stop code execution. I think the current networking code can only handle one client at a time resulting in this message when the first (or maybe the second) client has disconnected.

Comment thread src/vorta/application.py

init_translations(self)
self.message_received_event.connect(self.message_received_event_response)
if not args.profile:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if True is generally quicker to read than if not XX. And since we have a large code block under this condition now, it should get at least a comment on when this path is chosen. Still, keeping most of the code on the default path and dealing with exceptions some other way is preferable.

@m3nu m3nu self-assigned this Jun 23, 2023
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.

vorta --create should block and return borg exit status

3 participants