Skip to content

fix(upgrade): add 5-minute timeout to pre-upgrade backup#447

Closed
jorgehara wants to merge 1 commit into
Gentleman-Programming:mainfrom
jorgehara:fix/backup-timeout-446
Closed

fix(upgrade): add 5-minute timeout to pre-upgrade backup#447
jorgehara wants to merge 1 commit into
Gentleman-Programming:mainfrom
jorgehara:fix/backup-timeout-446

Conversation

@jorgehara
Copy link
Copy Markdown

Closes #446

Summary

  • Adds 5-minute timeout to backup creation during upgrade
  • Prevents indefinite hangs when backing up large config directories
  • Fails gracefully with warning if timeout exceeded, upgrade proceeds

Changes

File Change
\internal/backup/snapshot.go\ Add \context.Context\ parameter to \Create(), check cancellation between files
\internal/update/upgrade/executor.go\ Wrap backup call with 5-min timeout context
\internal/cli/run.go\ Add timeout to install/sync backup
\internal/components/uninstall/service.go\ Add timeout to uninstall backup
*_test.go\ Update all test mocks to accept context parameter

Test Plan

  • All existing backup tests pass
  • Project compiles without errors
  • Manually verified timeout behavior (backup exceeds 5min → graceful failure)
  • Pre-existing test failures unrelated to this change (verified on main branch)

Contributor Checklist

Prevents indefinite hangs when backing up large config directories
(e.g., .cursor/extensions, .claude/projects with 1000s of files).

Changes:
- Add context.Context parameter to backup.Snapshotter.Create()
- Wrap Create() call with 5-minute timeout in all locations
- Check context cancellation between file operations
- Update all tests to pass context.Background()
- Graceful failure with warning if backup exceeds timeout

Benefits entire community - not just Cursor users. Any large
config directory (node_modules, IDE extensions, session history)
could trigger this hang.

Closes #446
@jorgehara jorgehara force-pushed the fix/backup-timeout-446 branch from abfebc5 to 53a3ad9 Compare May 8, 2026 16:46
Copy link
Copy Markdown
Contributor

@Alan-TheGentleman Alan-TheGentleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a useful bugfix, but the diff is too large for the stated behavior change.

Please add the required type:bug label and either split the context-plumbing churn from the timeout behavior or request a documented size:exception with a clear review boundary.

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.

fix(upgrade): pre-upgrade backup hangs indefinitely on large config directories

2 participants