-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: provide a method for the user to bypass the first run dialog #344
base: main
Are you sure you want to change the base?
feat: provide a method for the user to bypass the first run dialog #344
Conversation
…download In the case that Ou Dedetai is started with an existing user directory, we know that at some point in the past the user launched Logos for the first time and logged in. Since we know they're already logged in, they should be past the first run dialog. However in the case the dialog failed for whatever reason, the key may still be set in the database. Provide a means for the user to easily bypass this first run dialog in the case that it failed. While there is some risk that in the future Logos will introduce some logic into this first run dialog that's strictly required for the app to function, if that's the case the worst this can do is a break a first time install - that's already likely broken. The user needs to reinstall anyways, we're no worse than we were. Tested: - Accepting and refusing using a crashed first time resource download on GUI and TUI and CLI - Opening Program settings after recovering, observed settings are restored from <data/> to actual contents. It should be noted that on the TUI and GUI if the user refuses the first prompt, they'll need to restart the app in order to change their mind. However on the other hand if the user actually wants to ignore it, this behavior is less intrusive. It should be noted that on the TUI, the user is prompted as if they were on the CLI - which is entirely fine, the user is already used to the terminal Still to test: - Exit the first run dialog very early, and see if skipping it causes any issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I or Nate need to test.
persistent_config.faithlife_product | ||
) | ||
except Exception: | ||
logging.exception("Failed to check to see if installation is broken.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want this to say something like, "Unable to detect an issue." We didn't fail our check in this case; we did check, but we didn't find anything.
ou_dedetai/utils.py
Outdated
@@ -653,6 +653,14 @@ def parse_bool(string: str) -> bool: | |||
return string.lower() in ['true', '1', 'y', 'yes'] | |||
|
|||
|
|||
def execute_sql(path: str | Path, sql_statements: list[str]) -> list[Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above; I think we should put SQL operations into a db.py module.
ou_dedetai/repair.py
Outdated
time.sleep(5) | ||
return | ||
local_user_prefrences_path = Path(logos_appdata_dir) / "Documents" / logos_user_id / "LocalUserPreferences" / "PreferencesManager.db" #noqa: E501 | ||
ou_dedetai.utils.execute_sql( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments on adding a db.py module.
We have a couple other bits of code in the works, sitting on the backburner, which also interact with the Logos sqlite DBs. It would be good to put these in their own module so that we don't have to retrieve them at a later time.
f"Recovery attempt of {app.conf.faithlife_product} complete. " | ||
f"{app.conf.faithlife_product} should now launch directly, " | ||
"bypassing first time resource download dialog." | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to include our instructions here telling the user to download their library.
BLOCKER: This leaves non-functional installs for now since the arial font is not installed. Factbook crashes after using this. Consider fixing the arial issue before merging this.
In the case that Ou Dedetai is started with an existing user directory, we know that at some point in the past the user launched Logos for the first time and logged in. Since we know they're already logged in, they should be past the first run dialog. However in the case the dialog failed for whatever reason, the key may still be set in the database.
Provide a means for the user to easily bypass this first run dialog in the case that it failed.
While there is some risk that in the future Logos will introduce some logic into this first run dialog that's strictly required for the app to function, if that's the case the worst this can do is a break a first time install - that's already likely broken. The user needs to reinstall anyways, we're no worse than we were.
Tested:
Unhandled exception: page fault on read access to 0x000000000000007c in 64-bit code (0x006ffff63389f1)
. Logos was trying to index at the time. Removed the Data/Documents directories, and slowly let Logos settle, after re-downloading all of my books it still crashes the same way. Installed "arial" font and resolved the issueIt should be noted that on the TUI and GUI if the user refuses the first prompt, they'll need to restart the app in order to change their mind. However on the other hand if the user actually wants to ignore it, this behavior is less intrusive.
It should be noted that on the TUI, the user is prompted as if they were on the CLI - which is entirely fine, the user is already used to the terminal
Still to test: