Skip to content

Chore/1028 cleanup temp snapshots#1059

Open
Olagoke22 wants to merge 3 commits intodotandev:mainfrom
Olagoke22:chore/1028-cleanup-temp-snapshots
Open

Chore/1028 cleanup temp snapshots#1059
Olagoke22 wants to merge 3 commits intodotandev:mainfrom
Olagoke22:chore/1028-cleanup-temp-snapshots

Conversation

@Olagoke22
Copy link
Copy Markdown
Contributor

================================================================================
TITLE:

chore(cleanup): implement temporary snapshot artifact pruning - Issue #1028

================================================================================
DESCRIPTION:

Overview

Implements a robust cleanup mechanism for temporary snapshot artifacts (disk-swapped snapshots and IPC pipes) to prevent /tmp clutter.

Changes

Core Implementation

  • Cleanup Registry: Added tempFiles tracking to bridge.Client to manage lifecycle of snapshot artifacts.
  • Robust Cleanup():
    • Iterates and removes registered temporary paths.
    • Added verbose logging to report the total count of pruned files.
  • Signal Handling:
    • Integrated os/signal in debug.go to catch SIGINT and SIGTERM.
    • Utilizes defer for standard exits and explicit calls for interrupted sessions.

Testing

  • Filesystem Verification: Added tests that check /tmp (or os.TempDir()) to ensure zero-leak state after execution.
  • Mock Signals: Verified that triggered interrupts still result in file removal.

Documentation

  • Internal documentation updated to reflect that temporary assets are now self-pruning.

Security & Performance

  • Resource Management: Prevents local storage exhaustion on long-running debug sessions.
  • Efficiency: Minimal overhead using a simple slice registry; zero redundant file system scans.

Configuration

  • verbose flag: When enabled, logs the summary of deleted artifacts.

Verification

  • Verified that /tmp is clear after SIGINT (Ctrl+C).
  • Verified that defer handles standard exits.
  • Confirmed DRY principles in the registry implementation.
  • All tests pass.

Related Issues

Closes #1028

Type of Change

  • New feature
  • Bug fix
  • Chore / Maintenance
  • Documentation update

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated
  • No new linting issues

… as JSON

- Implemented exportCurrentFrame method to save the current state as pretty JSON.
- Added command handling for "e" and "export" to trigger the export functionality.
- Updated help text to reflect the new export command in the InteractiveViewer.
- Modified package.json for consistent formatting and updated devDependencies.
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 28, 2026

@Olagoke22 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[TIME-TRAVEL] [CHORE] Clean up temporary snapshot artifacts after session

1 participant