Repository navigation
fix(hub): PSP archive layout, sync status and restore targets - #12
Merged
Merged
Conversation
Rotated archives were named after the client timestamp, which has whole seconds only, so a second upload in the same second overwrote the older version. Add a numeric suffix when the name is taken.
The frontend only uses the dialog plugin; all file and network access runs in Rust. Granting the webview read/write/remove under $HOME and arbitrary HTTP was unnecessary.
- Saving server settings sent a config without sources, which wiped the configured source list from config.json. Read-modify-write instead. - Cloud tab restore extracted every save into the first source folder, so RetroArch saves landed in PSP SAVEDATA (or a literal "Not found" folder). Pick the source by the save's platform and refuse native Vita saves. - Rescan after a restore so the status updates right away.
- Single-slot PSP saves were zipped without their slot folder and then extracted loose into SAVEDATA. They now keep the folder, matching the Vita app (which could not restore the old layout at all) and its content hash. Old flat archives restore into the folder named by their PARAM.SFO SAVEDATA_DIRECTORY. - correct_sync_refs adopted any local change as synced while the cloud was unchanged, so "upload needed" never appeared. It now only fills in a missing reference after a restore. - Restoring a cloud-only save left no manifest entry, so it showed as a conflict. The entry is created from the served hash. - Commands ran on the main thread and froze the window during network and zip work. They run on the async runtime now, with the config cloned out of its mutex and a lock serializing manifest writers. - ureq returns 4xx/5xx as errors, so status branches were dead and error bodies were lost. Map them explicitly; 404 gets its message. - Verify downloads against X-Save-Hash before extracting. - Temp zips are removed on error paths too. - psp_title_prefix no longer panics on multi-byte folder names. - Sanitize the multipart filename.
…heck - A panic while holding the sync or config lock made every later command fail until restart. Both guard data that stays consistent, so recover the guard instead. - A legacy flat PSP archive is only placed into its SAVEDATA_DIRECTORY folder when that folder belongs to the same game id.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a set of sync bugs in Save Sync Hub found in an audit and confirmed by a second reviewer.
Data and restore
PARAM.SFOandDATA.BINloose intoSAVEDATA/, and the Vita's Cloud tab could not restore them at all. Uploads now keep the folder, the same layout and content hash the Vita uses. Archives already uploaded in the old layout restore into the folder named by theirSAVEDATA_DIRECTORY, and only when that folder belongs to the same game.SAVEDATA(or in a folder literally calledNot found). The target is now picked by platform, and native Vita saves are refused.X-Save-Hashbefore anything is extracted.Sync status
App behavior
config.json.Testing
cargo checkis clean, the frontend builds, andsvelte-checkreports the same 8 pre-existing errors asmain.SAVEDATA_DIRECTORYlookup, wrapped uploads, hash-verified download, the 404 and 401 messages, and three same-second uploads keeping both older versions.Not included
null.