Repository navigation
fix(worlds): preserve world date on transfer, log delete errors, and keep live region mounted (#630) - #795
Conversation
…keep live region mounted (#630)
Pixnop
left a comment
There was a problem hiding this comment.
I reviewed a3da9e37 against dev adab6b96: ran your new tests against dev's code, read every path that copies, restores or deletes a world file, then made utimes fail during a copy and a move, with and without the .catch.
Each fix sits where the issue points. A move is a copy followed by a remove, so restoring the times right after copyFile (worldsHandlers.ts:415) covers both modes, and no other world operation copies a world file (restore goes through tar, which keeps the date). The stat runs after findWorld has refused links and inside the outer try, so a failure there is logged like any other transfer error and the lease is still released. Both delete branches now log at warn with the usual debug line. The warning paragraph is mounted with the page, so its text change gets announced, which is the same pattern as ManageModsSelectionBar. On dev's code the three new tests fail and the other 77 in those two files pass. On this head all 80 pass. It merges cleanly with #791, the other open PR that touches worldsHandlers.ts, and it touches no locale file.
Approving. Note 1 is worth taking here, since it is one line and one test. The rest can wait.
Not blocking
-
A failed
utimesleaves no trace, and nothing tests that it is tolerated..catch(() => undefined)atworldsHandlers.ts:415drops the error. On a share or a removable drive that refuses to set times, the copy jumps to the top of the list again, which is what #630 reports, and the log says nothing. I madeutimesreject during a move: it returnsok, the source is gone, the copy is there, and nothing about the move is logged. Then I removed the.catch: the same move returnsoperation-failedand leaves the world in both Installations, and all 80 tests still pass. A debug line in the catch, something like[TRANSFER] Kept the transfer time on the copied world: ..., and one test withvi.spyOn(fse, "utimes").mockRejectedValueOnce(new Error("EPERM"))that expectsokand checks the source and target would pin both. -
A failed world backup delete is still silent. On the same page,
removeWorldBackupArchiveswallows every error (worldsHandlers.ts:150), anddeleteWorldBackupturns that intooperation-failedwith no log call (worldsHandlers.ts:470). An archive held open by an antivirus on Windows gives the player an error and the log no reason, the same cost #630 describes for worlds. The issue doesn't name it, so a follow-up issue is fine. If you take it here, a[DELETE BACKUP]warn line indeleteWorldBackupwhen the result is not ok covers the manual delete. Pruning has the same gap:pruneOldestBackupsreturnsprune-failedinstead of throwing, and its caller only logs a throw (:266), so a prune that cannot remove an archive is silent too. -
The warning condition is written out three times.
target && worldVersionWarning(installation.version, target.version)appears atManageInstallationWorlds.tsx:289,:305and:307, so a later edit to one copy can put the description, the visibility and the text out of step. Oneconst showTargetWarning = ...after theif (!installation)guard would fix it. The id is also a literal (:302), while this component already takes ids fromuseId()(deleteNameId,:65).aria-live="polite"repeats whatrole="status"already implies, which is harmless. -
The outer delete line reads like a removal failure. The outer catch mostly fires when
assertManagedDeletionPathrefuses the path, before anything is removed, but "Could not finish deleting this world." (worldsHandlers.ts:308) is close to the inner "Could not finish removing this world save." (:303). The backup handler words its outer branch "Could not prepare this world backup." (:279). Something like "Could not prepare this world delete." would tell a guard refusal from a filesystem error without the debug line.
|
I reviewed Round oneA failed The outer delete line now reads as a preparation failure. The warning condition is written once. A failed backup delete and a failed prune now warn, but no test notices if the lines go away. The warns at Still approved. Not blocking
|
Summary
Addresses three issues reported in #630 across world operations and accessibility:
Type
Checklist
Testing
Executed the full test suite and build verification:
Related issues
Fixes #630