Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Have the helper say it has no record of a move, not that it never made it
Țugui Dragoș1b3582e5af24
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstringsindex 76740868..d5f24130 100644--- a/Localization/Peel/Localizable.xcstrings+++ b/Localization/Peel/Localizable.xcstrings@@ -129683,214 +129683,214 @@}}},- "Peel’s helper didn’t move this from there, so it stays in the Trash. You can drag it back out in Finder." : {+ "Peel’s helper had too many folders open at once. Try again." : {"localizations" : {"cs" : {"stringUnit" : {"state" : "translated",- "value" : "Pomocník Peelu to odtamtud nepřesunul, takže to zůstává v koši. Ve Finderu to můžete přetáhnout zpět ven."+ "value" : "Pomocník Peelu měl otevřeno příliš mnoho složek najednou. Zkuste to znovu."}},"de" : {"stringUnit" : {"state" : "translated",- "value" : "Das Hilfsprogramm von Peel hat dies nicht von dort verschoben, daher bleibt es im Papierkorb. Du kannst es im Finder wieder herausziehen."+ "value" : "Das Hilfsprogramm von Peel hatte zu viele Ordner gleichzeitig geöffnet. Versuche es erneut."}},"es" : {"stringUnit" : {"state" : "translated",- "value" : "El asistente de Peel no trasladó esto desde ahí, así que se queda en la papelera. Puedes sacarlo arrastrándolo en el Finder."+ "value" : "El asistente de Peel tenía demasiadas carpetas abiertas a la vez. Vuelve a intentarlo."}},"fr" : {"stringUnit" : {"state" : "translated",- "value" : "Ce n’est pas l’utilitaire de Peel qui a déplacé cet élément depuis cet emplacement : il reste donc dans la corbeille. Vous pouvez l’en sortir dans le Finder, en le faisant glisser."+ "value" : "L’utilitaire de Peel avait trop de dossiers ouverts à la fois. Réessayez."}},"it" : {"stringUnit" : {"state" : "translated",- "value" : "Non è stato l’assistente di Peel a spostarlo da lì, quindi resta nel Cestino. Puoi trascinarlo fuori nel Finder."+ "value" : "L’assistente di Peel aveva troppe cartelle aperte contemporaneamente. Riprova."}},"ja" : {"stringUnit" : {"state" : "translated",- "value" : "これはPeelのヘルパーがそこから移動したものではないため、ゴミ箱に残ります。Finderでドラッグして取り出せます。"+ "value" : "Peelのヘルパーが同時に開いているフォルダが多すぎました。もう一度試してください。"}},"ko" : {"stringUnit" : {"state" : "translated",- "value" : "Peel 보조 프로그램이 그곳에서 이 항목을 이동한 것이 아니므로 휴지통에 그대로 남습니다. Finder에서 드래그하여 꺼낼 수 있습니다."+ "value" : "Peel 보조 프로그램이 한 번에 너무 많은 폴더를 열어 두었습니다. 다시 시도하십시오."}},"nl" : {"stringUnit" : {"state" : "translated",- "value" : "Het hulpprogramma van Peel heeft dit niet daarvandaan verplaatst, dus het blijft in de prullenmand. Je kunt het in Finder er weer uit slepen."+ "value" : "Het hulpprogramma van Peel had te veel mappen tegelijk open. Probeer het opnieuw."}},"pl" : {"stringUnit" : {"state" : "translated",- "value" : "Pomocnik Peel nie przeniósł tego z tamtego miejsca, więc zostaje to w Koszu. Możesz przeciągnąć to z Kosza w Finderze."+ "value" : "Pomocnik Peel miał naraz otwartych zbyt wiele folderów. Spróbuj ponownie."}},"pt" : {"stringUnit" : {"state" : "translated",- "value" : "O auxiliar do Peel não moveu isto de lá, então fica no Lixo. Você pode arrastá-lo para fora no Finder."+ "value" : "O auxiliar do Peel estava com pastas demais abertas ao mesmo tempo. Tente novamente."}},"ro" : {"stringUnit" : {"state" : "translated",- "value" : "Instrumentul de ajutor Peel nu a mutat acest articol de acolo, așa că rămâne în Coș. În Finder, îl puteți trage afară de acolo."+ "value" : "Instrumentul de ajutor Peel avea prea multe dosare deschise în același timp. Încercați din nou."}},"ru" : {"stringUnit" : {"state" : "translated",- "value" : "Помощник Peel не перемещал это оттуда, поэтому оно остается в Корзине. В Finder его можно перетащить из Корзины обратно."+ "value" : "У помощника Peel было открыто слишком много папок одновременно. Попробуйте еще раз."}},"sv" : {"stringUnit" : {"state" : "translated",- "value" : "Peels hjälpprogram flyttade inte det här därifrån, så det ligger kvar i papperskorgen. Du kan dra ut det igen i Finder."+ "value" : "Peels hjälpprogram hade för många mappar öppna samtidigt. Försök igen."}},"tr" : {"stringUnit" : {"state" : "translated",- "value" : "Bunu oradan Peel’in yardımcısı taşımadı, bu yüzden Çöp Sepeti’nde kalıyor. Onu Finder’da sürükleyerek dışarı çıkarabilirsiniz."+ "value" : "Peel’in yardımcısı aynı anda çok fazla klasör açmıştı. Yeniden deneyin."}},"uk" : {"stringUnit" : {"state" : "translated",- "value" : "Помічник Peel не переміщував цього звідти, тож воно лишається в Смітнику. У Finder його можна перетягнути зі Смітника назад."+ "value" : "У помічника Peel було відкрито забагато папок одночасно. Спробуйте ще раз."}},"zh-Hans" : {"stringUnit" : {"state" : "translated",- "value" : "此项不是由Peel的帮助程序从那里移走的,因此它会留在废纸篓中。你可以在“访达”中将它拖出来。"+ "value" : "Peel的帮助程序同时打开的文件夹过多。请再试一次。"}},"zh-Hant" : {"stringUnit" : {"state" : "translated",- "value" : "此項目不是由Peel的輔助程式從那裡移出的,因此它會留在「垃圾桶」中。你可以在Finder中將它拖出來。"+ "value" : "Peel的輔助程式同時打開的檔案夾過多。請再試一次。"}}}},- "Peel’s helper had too many folders open at once. Try again." : {+ "Peel’s helper has no record of moving this from there, so it stays in the Trash. You can drag it back out in Finder." : {"localizations" : {"cs" : {"stringUnit" : {"state" : "translated",- "value" : "Pomocník Peelu měl otevřeno příliš mnoho složek najednou. Zkuste to znovu."+ "value" : "Pomocník Peelu nemá záznam o tom, že by to odtamtud přesunul, takže to zůstává v koši. Ve Finderu to můžete přetáhnout zpět ven."}},"de" : {"stringUnit" : {"state" : "translated",- "value" : "Das Hilfsprogramm von Peel hatte zu viele Ordner gleichzeitig geöffnet. Versuche es erneut."+ "value" : "Das Hilfsprogramm von Peel hat keine Aufzeichnung darüber, dass es dies von dort verschoben hat, daher bleibt es im Papierkorb. Du kannst es im Finder wieder herausziehen."}},"es" : {"stringUnit" : {"state" : "translated",- "value" : "El asistente de Peel tenía demasiadas carpetas abiertas a la vez. Vuelve a intentarlo."+ "value" : "El asistente de Peel no tiene ningún registro de haber trasladado esto desde ahí, así que se queda en la papelera. Puedes sacarlo arrastrándolo en el Finder."}},"fr" : {"stringUnit" : {"state" : "translated",- "value" : "L’utilitaire de Peel avait trop de dossiers ouverts à la fois. Réessayez."+ "value" : "L’utilitaire de Peel n’a aucune trace du déplacement de cet élément depuis cet emplacement : il reste donc dans la corbeille. Vous pouvez l’en sortir dans le Finder, en le faisant glisser."}},"it" : {"stringUnit" : {"state" : "translated",- "value" : "L’assistente di Peel aveva troppe cartelle aperte contemporaneamente. Riprova."+ "value" : "L’assistente di Peel non ha traccia di averlo spostato da lì, quindi resta nel Cestino. Puoi trascinarlo fuori nel Finder."}},"ja" : {"stringUnit" : {"state" : "translated",- "value" : "Peelのヘルパーが同時に開いているフォルダが多すぎました。もう一度試してください。"+ "value" : "Peelのヘルパーには、これをそこから移動した記録がないため、ゴミ箱に残ります。Finderでドラッグして取り出せます。"}},"ko" : {"stringUnit" : {"state" : "translated",- "value" : "Peel 보조 프로그램이 한 번에 너무 많은 폴더를 열어 두었습니다. 다시 시도하십시오."+ "value" : "Peel 보조 프로그램에 그곳에서 이 항목을 이동한 내역이 없으므로 휴지통에 그대로 남습니다. Finder에서 드래그하여 꺼낼 수 있습니다."}},"nl" : {"stringUnit" : {"state" : "translated",- "value" : "Het hulpprogramma van Peel had te veel mappen tegelijk open. Probeer het opnieuw."+ "value" : "Het hulpprogramma van Peel heeft geen registratie waaruit blijkt dat het dit daarvandaan heeft verplaatst, dus het blijft in de prullenmand. Je kunt het in Finder er weer uit slepen."}},"pl" : {"stringUnit" : {"state" : "translated",- "value" : "Pomocnik Peel miał naraz otwartych zbyt wiele folderów. Spróbuj ponownie."+ "value" : "Pomocnik Peel nie ma zapisu o przeniesieniu tego z tamtego miejsca, więc zostaje to w Koszu. Możesz przeciągnąć to z Kosza w Finderze."}},"pt" : {"stringUnit" : {"state" : "translated",- "value" : "O auxiliar do Peel estava com pastas demais abertas ao mesmo tempo. Tente novamente."+ "value" : "O auxiliar do Peel não tem registro de ter movido isto de lá, então fica no Lixo. Você pode arrastá-lo para fora no Finder."}},"ro" : {"stringUnit" : {"state" : "translated",- "value" : "Instrumentul de ajutor Peel avea prea multe dosare deschise în același timp. Încercați din nou."+ "value" : "Instrumentul de ajutor Peel nu are nicio evidență că ar fi mutat acest articol de acolo, așa că rămâne în Coș. În Finder, îl puteți trage afară de acolo."}},"ru" : {"stringUnit" : {"state" : "translated",- "value" : "У помощника Peel было открыто слишком много папок одновременно. Попробуйте еще раз."+ "value" : "У помощника Peel нет записи о том, что он перемещал это оттуда, поэтому оно остается в Корзине. В Finder его можно перетащить из Корзины обратно."}},"sv" : {"stringUnit" : {"state" : "translated",- "value" : "Peels hjälpprogram hade för många mappar öppna samtidigt. Försök igen."+ "value" : "Peels hjälpprogram har ingen uppgift om att ha flyttat det här därifrån, så det ligger kvar i papperskorgen. Du kan dra ut det igen i Finder."}},"tr" : {"stringUnit" : {"state" : "translated",- "value" : "Peel’in yardımcısı aynı anda çok fazla klasör açmıştı. Yeniden deneyin."+ "value" : "Peel’in yardımcısında, bunu oradan taşıdığına dair bir kayıt yok, bu yüzden Çöp Sepeti’nde kalıyor. Onu Finder’da sürükleyerek dışarı çıkarabilirsiniz."}},"uk" : {"stringUnit" : {"state" : "translated",- "value" : "У помічника Peel було відкрито забагато папок одночасно. Спробуйте ще раз."+ "value" : "Помічник Peel не має запису про те, що переміщував це звідти, тож воно лишається в Смітнику. У Finder його можна перетягнути зі Смітника назад."}},"zh-Hans" : {"stringUnit" : {"state" : "translated",- "value" : "Peel的帮助程序同时打开的文件夹过多。请再试一次。"+ "value" : "Peel的帮助程序没有从那里移走此项的记录,因此它会留在废纸篓中。你可以在“访达”中将它拖出来。"}},"zh-Hant" : {"stringUnit" : {"state" : "translated",- "value" : "Peel的輔助程式同時打開的檔案夾過多。請再試一次。"+ "value" : "Peel的輔助程式沒有從那裡移出此項目的記錄,因此它會留在「垃圾桶」中。你可以在Finder中將它拖出來。"}}}diff --git a/Packages/PeelCore/Sources/PeelCore/Support/FixedSentence.swift b/Packages/PeelCore/Sources/PeelCore/Support/FixedSentence.swiftindex df1115ea..ac49640e 100644--- a/Packages/PeelCore/Sources/PeelCore/Support/FixedSentence.swift+++ b/Packages/PeelCore/Sources/PeelCore/Support/FixedSentence.swift@@ -11,7 +11,7 @@ public enum FixedSentence: CaseIterable, Sendable {case notThereAnymore, alreadyThere, protectedByMacOS, irreplaceable, codeFolder, onlyLinksThere, leadsSomewherecase onlyGoneProgramsTherecase helperOutOfDate, accountNotAllowed, tooManyItems, noTrash, pathTooLong, cannotKeepRecord, cannotReadRecord- case notInTrash, notMovedByHelper, invalidRequest, configurationMissing, declaredTwice+ case notInTrash, notInHelpersRecord, invalidRequest, configurationMissing, declaredTwicecase toolTimedOut, toolStoppedcase receiptMisplaced, receiptForgotten, homebrewNotInstalled, helperUnavailable@@ -46,7 +46,7 @@ public enum FixedSentence: CaseIterable, Sendable {case .cannotKeepRecord: HelperRefusal.cannotKeepRecord.rawValuecase .cannotReadRecord: HelperRefusal.cannotReadRecord.rawValuecase .notInTrash: HelperRefusal.notInTrash.rawValue- case .notMovedByHelper: HelperRefusal.notMovedByHelper.rawValue+ case .notInHelpersRecord: HelperRefusal.notInRecord.rawValuecase .invalidRequest: HelperRefusal.invalidRequest.rawValuecase .configurationMissing: HelperRefusal.missingConfiguration.rawValuecase .declaredTwice: HelperRefusal.declaredTwice.rawValuediff --git a/Packages/PeelCore/Sources/PeelPrivileged/HelperLedger.swift b/Packages/PeelCore/Sources/PeelPrivileged/HelperLedger.swiftindex a62daf65..b6f5a5be 100644--- a/Packages/PeelCore/Sources/PeelPrivileged/HelperLedger.swift+++ b/Packages/PeelCore/Sources/PeelPrivileged/HelperLedger.swift@@ -24,6 +24,8 @@ public final class HelperLedger: Sendable {public static let defaultFolder = "/private/var/db/\(HelperIdentity.helperIdentifier)"public static let defaultURL = URL(filePath: defaultFolder + "/moved.plist")+ /// How many of the items it moved last the ledger keeps. An older one can no longer be put back by the helper.+ public static let entriesKept = 20_000private let url: URLprivate let maximumEntries: Int@@ -36,7 +38,7 @@ public final class HelperLedger: Sendable {/// because an item moved without a record cannot be put back.public init?(at url: URL = HelperLedger.defaultURL,- maximumEntries: Int = 20_000,+ maximumEntries: Int = HelperLedger.entriesKept,flush: @escaping @Sendable (String) -> Bool = DriveFlush.file(at:)) {let folder = url.deletingLastPathComponent().path(percentEncoded: false)diff --git a/Packages/PeelCore/Sources/PeelPrivileged/HelperRefusal.swift b/Packages/PeelCore/Sources/PeelPrivileged/HelperRefusal.swiftindex 7bc27989..a927ee51 100644--- a/Packages/PeelCore/Sources/PeelPrivileged/HelperRefusal.swift+++ b/Packages/PeelCore/Sources/PeelPrivileged/HelperRefusal.swift@@ -10,7 +10,7 @@ public enum HelperRefusal: String, CaseIterable, Sendable {case cannotKeepRecord = "Peel’s helper can’t keep its record of what it moves, so nothing was moved."case cannotReadRecord = "Peel’s helper can’t read its record of what it moved, so nothing was put back."case notInTrash = "It isn’t in the Trash."- case notMovedByHelper = "Peel’s helper didn’t move this from there, so it stays in the Trash. You can drag it back out in Finder."+ case notInRecord = "Peel’s helper has no record of moving this from there, so it stays in the Trash. You can drag it back out in Finder."case invalidRequest = "The request wasn’t valid."case missingConfiguration = "The configuration file is missing."case declaredTwice = "Two files declare this job."diff --git a/Packages/PeelCore/Tests/PeelCoreTests/DocumentationTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/DocumentationTests.swiftindex 64b73acd..7e3bb987 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/DocumentationTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/DocumentationTests.swift@@ -34,6 +34,7 @@ struct DocumentationTests {let languages = try StringCatalogTests.declaredLanguages().count + 1let tweaks = TweakCatalog.all.filter { $0.group != .terminal }.countlet records = RemovalLog.maximumRecords.formatted(.number.locale(Locale(identifier: "en_US")))+ let ledgerItems = HelperLedger.entriesKept.formatted(.number.locale(Locale(identifier: "en_US")))let idle = Int(HelperLifetime.standardIdleTimeout)let results = FileSearch.maximumResults.formatted(.number.locale(Locale(identifier: "en_US")))let minutes = Int(HoldBack.stillInUse / 60)@@ -48,6 +49,7 @@ struct DocumentationTests {("GUIDE.md", "Tweaks gathers \(tweaks) settings"),("README.md", "keeps the latest \(records) items"),("SAFETY.md", "keeps the most recent \(records) items"),+ ("SAFETY.md", "holds the last \(ledgerItems) items it moved"),("ARCHITECTURE.md", "keeps the most recent \(records) items"),("SAFETY.md", "at most \(HelperRequest.maximumItems) items in one request"),("ARCHITECTURE.md", "at most \(HelperRequest.maximumItems) items"),diff --git a/Packages/PeelCore/Tests/PeelCoreTests/HelperLedgerTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/HelperLedgerTests.swiftindex d76ebb0c..e94a8055 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/HelperLedgerTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/HelperLedgerTests.swift@@ -308,6 +308,10 @@ struct HelperLedgerTests {try ledger.origin(of: try #require(policy.openInTrash($0, trash: trash)), movedBy: getuid())}#expect(origins.map { $0 != nil } == [false, true, true])+ #expect(+ HelperRefusal.notInRecord.rawValue.hasPrefix("Peel’s helper has no record of moving this from there"),+ "the helper moved a.plist, and its Put Back would say it didn't"+ )let attributes = try FileManager.default.attributesOfItem(atPath: path("private/moved.plist", in: directory))#expect(attributes[.posixPermissions] as? Int == 0o600)diff --git a/Peel/Views/FixedSentenceText.swift b/Peel/Views/FixedSentenceText.swiftindex 5d9bd411..25251215 100644--- a/Peel/Views/FixedSentenceText.swift+++ b/Peel/Views/FixedSentenceText.swift@@ -28,7 +28,7 @@ extension FixedSentence {case .cannotKeepRecord: "Peel’s helper can’t keep its record of what it moves, so nothing was moved."case .cannotReadRecord: "Peel’s helper can’t read its record of what it moved, so nothing was put back."case .notInTrash: "It isn’t in the Trash."- case .notMovedByHelper: "Peel’s helper didn’t move this from there, so it stays in the Trash. You can drag it back out in Finder."+ case .notInHelpersRecord: "Peel’s helper has no record of moving this from there, so it stays in the Trash. You can drag it back out in Finder."case .invalidRequest: "The request wasn’t valid."case .configurationMissing: "The configuration file is missing."case .declaredTwice: "Two files declare this job."diff --git a/PeelHelper/HelperService.swift b/PeelHelper/HelperService.swiftindex 447702f6..80de9464 100644--- a/PeelHelper/HelperService.swift+++ b/PeelHelper/HelperService.swift@@ -118,7 +118,7 @@ final class HelperService: NSObject, PeelHelperProtocol {else {return reply(HelperRefusal.cannotReadRecord.rawValue)}- guard origin == target.path else { return reply(HelperRefusal.notMovedByHelper.rawValue) }+ guard origin == target.path else { return reply(HelperRefusal.notInRecord.rawValue) }switch TrashMover.rename(trashed, to: target.name, in: target.parent) {case .success:ledger.forget([trashed])diff --git a/SAFETY.md b/SAFETY.mdindex a67332c4..f4838a1a 100644--- a/SAFETY.md+++ b/SAFETY.md@@ -647,7 +647,8 @@ and it fails closed.the helper took it from. Something dropped into your Trash by hand, or swapped in under a known name, staysthere. An item moves only once its record is on the drive itself, so a power cut can't keep the move and losethe record. While the ledger can't be read, the helper moves nothing and puts nothing back; one it can't make- sense of is kept under another name, never written over, and a new one begins. A folder that code is loaded from+ sense of is kept under another name, never written over, and a new one begins. It holds the last 20,000 items it+ moved: an item it has no record of stays in the Trash, and Put Back says so. A folder that code is loaded fromtakes back only what is still owned by root and writable by nobody else. Peel says so before it moves a plug-inthat isn't, and Put Back says so too, since Finder can still drag it back out.