Skip to content

sync: a save folder that cannot be written is said once, and waited on - #114

Open
ChakraFusion wants to merge 1 commit into
Liquid-co:dev-publicfrom
ChakraFusion:pr/unwritable-once
Open

ChakraFusion wants to merge 1 commit into
Liquid-co:dev-publicfrom
ChakraFusion:pr/unwritable-once

Conversation

@ChakraFusion

Copy link
Copy Markdown

A save folder this device may not write to (one under Program Files, for a program not run as administrator) fails every pull into it with "access denied". Every pass from every peer tried again, and each logged the same raw error ("sync … failed: patch save.dat: create temp file: … Access is denied"), saying nothing about what to do.

The change (syncengine/unwritable.go):

  • When a pull fails with a permission error, it is said once, plainly: OpenSave may not write to that folder; give it write access or track the game at another folder; trying again in 30 minutes.
  • Pulls into that save then wait 30 minutes before trying again. This is held in memory, so a restart (perhaps with new rights) tries at once.
  • The peer's result is unwritable, which, like a conflict, does not advance the last-synced stamp.

Test: TestUnwritable_SaidOnceAndNotRetriedEveryPass. On Windows it denies writes on its own temp folder with icacls, which is how a folder under Program Files behaves; elsewhere it uses chmod. Over three passes, the message appears once. Once the wait is over and the rights are back, the next pass takes the peer's save. On dev-public the same setup logged the raw error on every pass.

Checks: the full unit and e2e suites pass locally on today's dev-public.

🤖 Generated with Claude Code

A save folder this device may not write to (one under Program Files, for
a program not run as administrator) failed every pull into it with the
same raw "access denied", from every peer, on every pass. It is now said
once, with what to do, and pulls into it wait 30 minutes before trying
again (in memory, so a restart tries at once). The peer result is
"unwritable", which, like a conflict, does not advance the last-synced
stamp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 21, 2026

Copy link
Copy Markdown

@ChakraFusion is attempting to deploy a commit to the sivadaboi's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Omar-VF

Omar-VF commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Thanks, saying this once with what to do is much better than the raw error on every pass. One concern: on Windows, renaming over a file that a running game holds open also fails with "Access is denied" (it surfaces as fs.ErrPermission after replaceWithRetry gives up). A save the game simply has open would then get "OpenSave may not write to its save folder" and a 30-minute wait. Could noteUnwritable confirm the folder itself refuses writes first, for example by creating and removing a small probe file in it, and only then declare it unwritable? If the probe works, it's a file in use, and the ordinary retry applies.

This branch has not been deployed

No deployments
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