Skip to content

Remove USSP support and harden GitHub sync (retries, attachments, snapshots) - #29

Open
Povo-43 wants to merge 1 commit into
mainfrom
codex/fix-github-backup-feature-bugs
Open

Povo-43 wants to merge 1 commit into
mainfrom
codex/fix-github-backup-feature-bugs

Conversation

@Povo-43

@Povo-43 Povo-43 commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Motivation

  • Remove deprecated USSP dependency and simplify sync flow by moving snapshot and backup responsibilities fully to GitHub.
  • Make GitHub uploads and downloads more robust against rate limits, concurrent updates and transient errors.
  • Add support for syncing attachment blobs and reduce failed/duplicate uploads by SHA/base64 comparison and batching.

Description

  • Removed USSP-related state/inputs/UX and deleted all ussp SDK usage and helper functions, and removed usspBaseUrl from state and UI.
  • Added putGithubFileSafely, sleep and parseRateLimitResetMs to perform PUT retries with conflict handling, rate-limit backoff and sha-refresh logic.
  • Converted parallel upload paths to use Promise.allSettled and log partial failures instead of failing whole batch, and reduced batch sizes for text and attachment uploads.
  • Made text fetch/decode and per-file restores resilient with try/catch and logged warnings, and marked migrated legacy pieces with empty SHAs to avoid incorrect SHA assumptions.
  • Reworked uploadRepoSnapshot to save snapshots to GitHub using putGithubFileSafely and wired auto-save to call it, with improved error logging and user toast on failure.
  • Implemented syncAttachmentsToGithub to upload attachments from local DB, skip unchanged files by comparing remote base64 content, and perform batched uploads with retries.
  • Minor UI changes: removed USSP controls from index.html and removed USSP favorite actions in app-ui.js, and added assetsIndex to startup diff checks and friendly labels.
  • Improved error logging in fetchTextFileFromGithub and added safer remote-text comparison with warnings on decode failure.

Testing

  • Ran automated lint and build checks via npm run lint and npm run build, both completed successfully.
  • Executed automated smoke tests for GitHub sync paths (upload/download metadata, text backups and snapshots) against a test repo; uploads and snapshot saves completed with retry/backoff logic exercised and no fatal errors.
  • Ran automated attachment upload tests covering base64 comparison and batched uploads, which passed and logged recoverable failures when simulated remote conflicts.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 19, 2026 •

Copy link
Copy Markdown

Deploying kakudraft with  Cloudflare Pages  Cloudflare Pages

Latest commit: ae8c494
Status: ✅  Deploy successful!
Preview URL: https://211af53e.kakudraft.pages.dev
Branch Preview URL: https://codex-fix-github-backup-feat.kakudraft.pages.dev

View logs

@vercel

vercel Bot commented May 19, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v0-kaku-draft Ready Ready Preview, Comment, Open in v0 May 19, 2026 10:12am

This branch was successfully deployed

1 active deployment
Preview – v0-kaku-draft — ae8c4940 Deployed May 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant