Skip to content

[Bug]: Running the 'Fix Ignored Entries' tool from the menu bar causes an error in the log #1187

@TrigamDev

Description

@TrigamDev

Checklist

  • I am using an up-to-date version.
  • I have read the documentation.
  • I have searched existing issues.

TagStudio Version

Alpha 9.5.5

Operating System & Version

Windows 11

Description

When using the 'Fix Ignored Entries' tool from the menu bar, removing the ignored entries causes the following error to be printed:

Traceback (most recent call last):
File "...\TagStudio\src\tagstudio\qt\controllers\fix_ignored_modal_controller.py", line 35, in <lambda>
    self.driver.library_info_window.update_cleanup(),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'QtDriver' object has no attribute 'library_info_window'

Running it from the 'Library Info' modal, however, doesn't result in the error being printed.

To clarify: this does NOT impede functionality, everything still functions as expected. I've just been running TagStudio from source and been seeing the error constantly.

Cause

In some places in fix_ignored_modal_controller.py, there are checks to make sure driver has the attribute library_info_window, such as in update_driver_widgets():

if (
    hasattr(self.driver, "library_info_window")
    and self.driver.library_info_window.isVisible()
):
    self.driver.library_info_window.update_cleanup()

However, in the callback for the remove_modal's 'done' button, there is no such check.

self.remove_modal.done.connect(
    lambda: (
        self.update_ignored_count(),
        self.driver.update_browsing_state(),
        self.driver.library_info_window.update_cleanup(),
        self.refresh_ignored(),
    )
)

Running the tool from the 'Library Info' modal doesn't cause an error since opening the modal causes library_info_window to be created. Running it from the menu bar, though, doesn't cause library_info_window to be created, leading to the error. This doesn't cause any loss of functionality, just an error to be printed.

Expected Behavior

No error should be printed, regardless of where the tool is being used from.

Steps to Reproduce

  1. Click on 'Tools' from the menu bar.
  2. Click on 'Fix Ignored Entries'.
  3. Click on 'Refresh' to update the ignored entries.
  4. Click on 'Remove ignored entries'.
  5. Click on 'Remove' in the confirmation dialogue.
  6. The error is then printed. The entries are still removed, however.

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: BugSomething isn't working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions