Repository navigation
feat(sync): review first — decide and ask everything, then transfer unattended - #80
Merged
Merged
Conversation
…nattended - B on the menu: every entry is listed and every file decided first, conflicts and the byte comparison before them included, with nothing transferred and the manifest untouched. The log then lists each transfer and the bottom screen asks once whether to start; the transfers run without another question. - The engine's syncFile() is split into decideFile(), which returns a FilePlan (source, generation, one action per side), and applyFile(). A normal sync applies each plan at once and behaves as before. - A save changed between the review and its transfer is left alone and reported. Comparison copies live with their plan and are reused. Drive's own one-way upload is held back until the second pass (SyncProvider::hasLegacyUpload()). - During the transfers the console refuses to sleep, so the lid can be closed without dropping Wi-Fi; the backlights go off meanwhile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michvllni
added a commit
that referenced
this pull request
Nov 9, 2026
* fix: open ptm:u and gsp::Lcd only while they are needed - v0.9.0 opened both services in componentsInit() and held them until exit. On a 2DS the whole console then froze after a while at the menu, HOME included, with no crash dump; the build before #80 did not. The system needs those sessions itself (dimming the screens after a while without input, among other things). - ptm:u is now opened by watchLid() for the unattended pass of a review-first sync only, and gsp::Lcd by setBacklights() for each call. The lid behaviour during that pass is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore: 0.9.1 - v0.9.0 freezes the console after a while at the menu; 0.9.1 carries the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
A normal sync decides and transfers each file in turn, so a conflict prompt can come up between two long transfers. A ROM over FTP from a phone took 6 minutes, so you had to keep watching the console for the whole run.
What changes
B on the menu, "Review first":
--- Review ---with every file to download or upload and where from or to. The bottom screen (SCREEN_REVIEW) says "Ready to transfer · N down, M up", with A Start and B/START Cancel.frontend::setUnattended()refuses sleep (aptSetSleepAllowed(false)) for this pass only, andframe()turns the backlights off while the lid is closed (PTMU_GetShellState(),GSPLCD_PowerOffBacklight()).Engine:
syncFile()is split in two.decideFile(): everything up to and including the conflict prompt. It returns aFilePlan: the sides, the source, the new generation, and oneSideActionper side (source, same, read-only, renumber, upload).applyFile(): carries the plan out, transfers first, then the manifest.syncEntry(), A) applies each plan at once, so it behaves exactly as before; the existing tests pass unchanged.planEntry()andapplyEntryPlan(), pluscountPlan()andplanLines()for the review list.transferPlanned()inmain.cppruns the second pass.Edge cases:
legacyUpload()) transfers as it goes, soSyncProvider::hasLegacyUpload()holds it back for the second pass.The README (controls, a "Review first" section) and AGENTS.md describe it.
Tests
make -C tests: 290 pass. New intest_review.cpp:The UI tests cover the B button and the review screen.
make -C tests previewrenders the menu, the review screen and the transferring card.node --test: 28 pass.The 3DS build has no warnings.
Tested on a console: questions first, then the review, then unattended transfers.
🤖 Generated with Claude Code