Skip to content

clear cache function#4119

Open
jadzeidan wants to merge 1 commit into
BitBoxSwiss:masterfrom
jadzeidan:clear-cache
Open

clear cache function#4119
jadzeidan wants to merge 1 commit into
BitBoxSwiss:masterfrom
jadzeidan:clear-cache

Conversation

@jadzeidan
Copy link
Copy Markdown
Contributor

add clear cache button in advanced settings so users don't need to manually navigate folders to delete them.

Before asking for reviews, here is a check list of the most common things you might need to consider:

  • updating the Changelog
  • writing unit tests
  • checking if your changes affect other coins or tokens in unintended ways
  • testing on multiple environments (Qt, Android, ...)
  • having an AI review your changes

@jadzeidan
Copy link
Copy Markdown
Contributor Author

@coderabbitai

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

@jadzeidan Sure! I'll review the changes in this PR now.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 51f31c75-d223-41be-ba84-fb75a8c4e809

📥 Commits

Reviewing files that changed from the base of the PR and between efef487 and 0a698c8.

📒 Files selected for processing (8)
  • backend/backend.go
  • backend/backend_test.go
  • backend/handlers/handlers.go
  • frontends/web/src/api/backend.ts
  • frontends/web/src/locales/en/app.json
  • frontends/web/src/routes/settings/advanced-settings.tsx
  • frontends/web/src/routes/settings/components/advanced-settings/clear-cache-setting.test.tsx
  • frontends/web/src/routes/settings/components/advanced-settings/clear-cache-setting.tsx
👮 Files not reviewed due to content moderation or server errors (8)
  • frontends/web/src/locales/en/app.json
  • backend/backend.go
  • backend/backend_test.go
  • backend/handlers/handlers.go
  • frontends/web/src/api/backend.ts
  • frontends/web/src/routes/settings/advanced-settings.tsx
  • frontends/web/src/routes/settings/components/advanced-settings/clear-cache-setting.test.tsx
  • frontends/web/src/routes/settings/components/advanced-settings/clear-cache-setting.tsx

📝 Walkthrough

Walkthrough

This PR adds a user-facing cache-clearing feature across the backend and web frontend. The backend tracks initialization state via a new started flag, refactors rate-updater setup into a newRatesUpdater() helper, and implements a ClearCache() method that safely removes cached exchange-rate data while preserving configuration and user data. The HTTP API exposes this via a new /api/clear-cache endpoint. The frontend provides a ClearCacheSetting React component integrated into advanced settings that displays a confirmation dialog, calls the backend API asynchronously, and reports errors to the user. Tests verify both backend behavior (data preservation) and frontend behavior (dialog interaction and API invocation).

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jadzeidan jadzeidan marked this pull request as ready for review May 9, 2026 12:12
@jadzeidan jadzeidan requested a review from a team as a code owner May 9, 2026 12:12
@jadzeidan jadzeidan marked this pull request as draft May 9, 2026 12:12
@jadzeidan
Copy link
Copy Markdown
Contributor Author

Tested successfully on macOS build and webview.

And the rabbit seems happy, ready for review.

@jadzeidan jadzeidan marked this pull request as ready for review May 9, 2026 14:18
Comment thread frontends/web/src/locales/en/app.json Outdated
Comment on lines +1948 to +1951
"primaryCTA": "Clear Cache",
"title": "Clear cache"
},
"title": "Clear cache"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Once is enough 😄

@benma
Copy link
Copy Markdown
Contributor

benma commented May 13, 2026

CI is failing, please fix.

@jadzeidan jadzeidan force-pushed the clear-cache branch 3 times, most recently from d1519fc to 4b26a3e Compare May 19, 2026 15:07
add clear cache button in advanced settings so users don't need
to manually navigate folders to delete them.
@jadzeidan
Copy link
Copy Markdown
Contributor Author

Address comments. @benma PTAL

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.

2 participants