Skip to content

No space left on disk alert#1

Open
alexandra-mara wants to merge 1 commit intomainfrom
alerts
Open

No space left on disk alert#1
alexandra-mara wants to merge 1 commit intomainfrom
alerts

Conversation

@alexandra-mara
Copy link
Collaborator

No description provided.

@alexandra-mara alexandra-mara self-assigned this Mar 5, 2026
@ReDetection
Copy link
Owner

@claude review

Comment on lines +47 to +50
#if os(macOS)
products.append(.executable(name: "Timeline-macOS", targets: ["TimelineCocoa"]))
targets.append(
.executableTarget(
Copy link
Owner

Choose a reason for hiding this comment

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

why to conditionalize it script-like instead of declarative style? This has drawback that on each platform it's going to basically be a different package file, resulting in a different Package.resolved lockfile, causing endless git diff and potential conflicts

Comment on lines +12 to +20
sources: [
"Alerts.swift",
"Logic/FilteredAppsStorage.swift",
"Logic/PureAlignedTimer.swift",
"Logic/PureCounter.swift",
"Logic/Tracker.swift",
"Storage/Model.swift",
"Storage/Storage.swift"
]),
Copy link
Owner

Choose a reason for hiding this comment

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

would be nice to not have every source file to be listed in the package file

lastAlertText = nil
} catch {
reportStorageError(error, action: "storing timeline")
if isDiskFull(error) {
Copy link
Owner

Choose a reason for hiding this comment

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

why don't just

Suggested change
if isDiskFull(error) {
if error == StorageError.diskFull {

Comment on lines +103 to +110
} catch {
reportStorageError(error, action: "storing timeline")
if isDiskFull(error) {
counter.clearAndPause()
if active {
tickAppCounter()
}
return
Copy link
Owner

Choose a reason for hiding this comment

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

Could you explain this piece for me please? If we are stuck with the disk being full and we could not persist the data, why to clear the data?

Comment on lines +121 to +124
} catch {
reportStorageError(error, action: "storing log")
if isDiskFull(error) {
break
Copy link
Owner

Choose a reason for hiding this comment

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

On line 110 there is the same pattern and the same check, but there is return and here is break. Could you explain the difference?

Comment on lines +159 to +162
let text = title + "|" + message
guard text != lastAlertText else {
return
}
Copy link
Owner

Choose a reason for hiding this comment

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

I am almost sure this should be the responsibility of the target apps, but I am fine to leave it here as it is for now 👌

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