Skip to content

feat: add profile reset endpoint (#15)#21

Open
hayka-pacha wants to merge 1 commit into
CloakHQ:mainfrom
hayka-pacha:feat/profile-reset
Open

feat: add profile reset endpoint (#15)#21
hayka-pacha wants to merge 1 commit into
CloakHQ:mainfrom
hayka-pacha:feat/profile-reset

Conversation

@hayka-pacha
Copy link
Copy Markdown

What

Adds a one-click profile reset that wipes browser state while preserving settings, closing #15.

Changes

  • POST /api/profiles/{id}/reset -- new endpoint that:
    • Stops the browser if running
    • Wipes 30+ browser state files (cookies, history, cache, local storage, session storage, IndexedDB, etc.)
    • Preserves Bookmarks and Preferences (search engine config)
    • Re-rolls fingerprint_seed to a new random value
    • Keeps all other settings (name, proxy, tags, platform, etc.)
  • backend/database.py -- new function
  • frontend/src/lib/api.ts -- new client method
  • 12 new tests (6 database unit tests + 6 API integration tests)

Test results

All 192 tests pass (180 existing + 12 new), zero warnings.

What this enables

Users can reset a profile between sessions to get a fresh fingerprint without recreating the profile. This is useful for:

  • Rotating identity between automation runs
  • Clearing accumulated cookies/tracking data
  • Quick profile refresh without losing configuration

Future work

  • Scheduled auto-reset (e.g., every 24 hours) -- could be added as a per-profile setting
  • UI reset button in the frontend ProfileForm component

Add POST /api/profiles/{id}/reset that:
- Stops browser if running
- Wipes browser state files (cookies, history, cache, local storage)
- Preserves Bookmarks and Preferences (search engine config)
- Re-rolls fingerprint_seed to a new random value
- Keeps all other profile settings (name, proxy, tags, etc.)

Changes:
- backend/database.py: add reset_profile() function
- backend/main.py: add POST /api/profiles/{id}/reset endpoint
- frontend/src/lib/api.ts: add resetProfile() client method
- backend/tests/test_api.py: 6 new API integration tests
- backend/tests/test_database.py: 6 new database unit tests

All 192 tests pass (180 existing + 12 new).
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.

1 participant