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

address Monterey changes causing TimeMachineProgress to error #266

Merged

Conversation

JonathanDoughty
Copy link
Contributor

I noticed after I upgraded to Monterey (12.2 or 12.3, not sure when it started) that TimeMacineProgress would sometimes appear to get stuck at the (prep) stage. That was being caused by an error - apparently tmutil status now reports intermediate phases that lack any Percent value. This PR addresses that error, bumps the version, and as a bonus provides a little more info in the (prep) tooltip during the various backup phases provided by the apparently modified tmutil's status results.

FWIW TimeMachineProgress's percentage stops advancing when TimeMachine goes into its 'cleaning up' phases, prior to 'stopping'. Addressing that is a separate issue that I'm not sure is worth the effort. I'm happy to try to help if you think it is.

Below is an example of the tmutil status data that triggers the stack dump:

2022-03-19 21:02:38:                          Backup is running
2022-03-19 21:02:38:                          Setting up menubar title to '(prep)'
2022-03-19 21:02:43: 21:02:43 TimeMachin:     tmutil status output: {
    BackupPhase = FindingChanges;
    ChangedItemCount = 3798;
    ClientID = "com.apple.backupd";
    DateOfStateChange = "2022-03-20 01:02:43 +0000";
    DestinationID = "48BF55E5-E974-4E47-83BE-846AFCB1DB13";
    DestinationMountPoint = "/Volumes/Time Machine Backups";
    EventFractionOfTotalProgressBar = "0.1";
    FractionDone = "0.07953837900431027";
    Running = 1;
    Stopping = 0;
    sizingFreePreflight = 1;
}


2022-03-19 21:02:43:                          Formatted data read by hs.plist: {
  BackupPhase = "FindingChanges",
  ChangedItemCount = "3798",
  ClientID = "com.apple.backupd",
  DateOfStateChange = "2022-03-20 01:02:43 +0000",
  DestinationID = "48BF55E5-E974-4E47-83BE-846AFCB1DB13",
  DestinationMountPoint = "/Volumes/Time Machine Backups",
  EventFractionOfTotalProgressBar = "0.1",
  FractionDone = "0.07953837900431027",
  Running = "1",
  Stopping = "0",
  sizingFreePreflight = "1"
}

2022-03-19 21:02:43:                          Backup is running
2022-03-19 21:02:43: 21:02:43 ERROR:   LuaSkin: hs.timer callback error: ...d/.hammerspoon/Spoons/TimeMachineProgress.spoon/init.lua:154: attempt to perform arithmetic on a nil value
stack traceback:
	...d/.hammerspoon/Spoons/TimeMachineProgress.spoon/init.lua:154: in function 'TimeMachineProgress.refresh'
	...d/.hammerspoon/Spoons/TimeMachineProgress.spoon/init.lua:216: in function <...d/.hammerspoon/Spoons/TimeMachineProgress.spoon/init.lua:216>

@cmsj cmsj closed this Aug 7, 2024
@cmsj cmsj reopened this Aug 7, 2024
@cmsj cmsj merged commit 93fd068 into Hammerspoon:master Aug 7, 2024
1 check passed
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.

2 participants