MeetingBar icon indicating copy to clipboard operation
MeetingBar copied to clipboard

Bug: App freezes when clicking on Calendars tab

Open davidneedham opened this issue 1 year ago • 7 comments

macOS version

Sequoia 15.0

MeetingBar version

4.10.0

Installation source

AppStore

Calendars provider

Google Calendar

Bug description

The app freezes (beachballs) when the Calendars tab is chosen from within Preferences. Every other tab and every other setting seems to work as expected.

I distinctly recall that this had been happening for awhile, then worked fine when I got a new computer, and is now beachballing again.

Reproduction steps

  1. Go to MeetingBar Preferences
  2. Click on Calendars
  3. Beachball
  4. Open Activity Monitor to force quit MeetingBar
  5. Open Meeting Bar and repeat from 1

Expected behavior

When I click the Calendars tab I'm able to select which calendars are used for MeetingBar.

Screenshots/screen recordings

No response

Additional context

Versions

  • App version 4.10.0 (however it's been doing this for several versions)
  • MacOS 15.0 (however it did this in the previous version too)

davidneedham avatar Sep 25 '24 16:09 davidneedham

Related to #283 ?

davidneedham avatar Sep 25 '24 16:09 davidneedham

Hey @davidneedham! I'm here to assist with bugs, questions, and contributions. Let's squash those bugs together! 🤖

The freezing issue when clicking on the Calendars tab in Preferences on macOS Sequoia 15.0 with Google Calendar as the provider is due to the loadCalendarList function being called on the main thread every second by a timer. This can cause the UI to freeze if the operation is time-consuming.

To fix this, you should move the loadCalendarList function to a background thread. Here is a possible solution:

  1. Update the timer to call loadCalendarList on a background thread:

    .onReceive(timer) { _ in 
        DispatchQueue.global(qos: .background).async {
            loadCalendarList()
        }
    }
    
  2. Modify the loadCalendarList function to update the UI on the main thread:

    func loadCalendarList() {
        let groupedCalendars = Dictionary(grouping: appDelegate!.statusBarItem.calendars) { $0.source }
        DispatchQueue.main.async {
            calendarsBySource = groupedCalendars
        }
    }
    

Additionally, ensure that the fetchAllCalendars method in the GCEventStore class handles network requests asynchronously to prevent UI blocking [1][2].

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 25 '24 16:09 dosubot[bot]

I deleted the app and re-installed with Homebrew. When I loaded it up, all of my settings were retained and it still crashed on the calendars tab.

davidneedham avatar Sep 25 '24 16:09 davidneedham

@dosu is there any way to totally clear out app preferences from the CLI?

davidneedham avatar Sep 25 '24 16:09 davidneedham

To completely clear out app preferences from the CLI, you can use the defaults command to delete the preferences for MeetingBar. Here is how you can do it:

  1. Open Terminal.

  2. Run the following command to delete the preferences:

    defaults delete com.leits.MeetingBar
    

This command will remove all stored preferences for MeetingBar, effectively resetting the app to its default state. After running this command, you can restart MeetingBar and see if the issue persists.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 25 '24 16:09 dosubot[bot]

To completely clear out app preferences from the CLI, you can use the defaults command to delete the preferences for MeetingBar. Here is how you can do it:

  1. Open Terminal.

  2. Run the following command to delete the preferences:

    defaults delete com.leits.MeetingBar
    

This command will remove all stored preferences for MeetingBar, effectively resetting the app to its default state. After running this command, you can restart MeetingBar and see if the issue persists.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 25 '24 16:09 dosubot[bot]

When I run that command the CLI returns Domain (com.leits.MeetingBar) not found.. I'll try something else.

davidneedham avatar Sep 25 '24 17:09 davidneedham

Hi folks, Thanks again for reporting this performance issue. I’ve just published a 4.11 beta release with a number of under-the-hood performance optimizations in MeetingBar. You can grab it here: https://github.com/leits/MeetingBar/releases/tag/v4.11.beta

Once you’ve had a chance to try it, could you please let me know whether you still see the issues? Any logs, profiled timings, or specific repro steps you can share will be super helpful. Thanks!

GitHub
Release v4.11 (beta) · leits/MeetingBar
This is a pre-release. I rewrote half of the app to improve stability and performance. What's Changed

Translations update from Hosted Weblate by @weblate in #738 Translations update from Hosted We...

leits avatar May 16 '25 17:05 leits

Thanks for reporting. The bug fix has been released! Feel free to reopen the issue if the error still occurs.

leits avatar May 29 '25 16:05 leits