Problem Statement / Context
The VS Code extension watches for local file saves and stages them in the cloud. However, between the time a user saves a file in VS Code and commits it via their phone, a colleague (or an automated pipeline) may push changes to the same branch on GitHub. Currently, pushing the GitPhone commit will either overwrite the remote changes or result in a PyGithub HTTP 409 Conflict crash, providing no recovery path for the mobile user.
Proposed Solution
Implement a Stale State Detection mechanism. When the user taps "Commit" in Telegram, the backend must verify the target branch's HEAD SHA against the base_sha recorded when the files were originally staged in VS Code.
Technical Implementation Details
- Update the VS Code extension payload to include the local
HEAD SHA when syncing a file change.
- In
github_service.py (commit method), before creating the tree, fetch the current remote branch HEAD SHA.
- If
local_sha != remote_sha, abort the commit and alert the user in Telegram.
- Provide interactive Telegram buttons:
- [Force Commit] - Proceeds with the commit (overwriting/creating a new tree).
- [Create New Branch] - Automatically creates a new branch (e.g.,
username/patch-1) and commits the staged files there to preserve work.
- [Abort] - Drops the staged files.
Acceptance Criteria
Impact & Risks
- Effort: High (Requires modifying extension, backend schema, and bot UX).
Problem Statement / Context
The VS Code extension watches for local file saves and stages them in the cloud. However, between the time a user saves a file in VS Code and commits it via their phone, a colleague (or an automated pipeline) may push changes to the same branch on GitHub. Currently, pushing the GitPhone commit will either overwrite the remote changes or result in a PyGithub HTTP 409 Conflict crash, providing no recovery path for the mobile user.
Proposed Solution
Implement a Stale State Detection mechanism. When the user taps "Commit" in Telegram, the backend must verify the target branch's
HEAD SHAagainst thebase_sharecorded when the files were originally staged in VS Code.Technical Implementation Details
HEAD SHAwhen syncing a file change.github_service.py(commitmethod), before creating the tree, fetch the current remote branchHEAD SHA.local_sha != remote_sha, abort the commit and alert the user in Telegram.username/patch-1) and commits the staged files there to preserve work.Acceptance Criteria
base_shaper staging session.Impact & Risks