Skip to content

Add reset options to danger zone#163

Merged
bradly0cjw merged 5 commits intomainfrom
danger-zone-reset-options
Mar 10, 2026
Merged

Add reset options to danger zone#163
bradly0cjw merged 5 commits intomainfrom
danger-zone-reset-options

Conversation

@rileychh
Copy link
Member

@rileychh rileychh commented Mar 5, 2026

Summary

  • Add four reset options to the danger zone section: clear cache, clear cookies, clear preferences, and clear user data
  • Clear cache deletes the app cache directory (avatars, any future caches)
  • Clear cookies resets the shared NTUT cookie jar
  • Clear preferences clears all SharedPreferences
  • Clear user data drops and recreates all database tables, clears cookies, and deletes all secure storage (requires re-login)
  • Add deleteEverything() to DatabaseActions using Drift's Migrator for clean drop+recreate
  • i18n strings for both en and zh-TW, with separate noun keys for snackbar messages

Test plan

  • Enable danger zone, verify all four new tiles appear after existing crash options
  • Tap each option and verify snackbar shows correct message (e.g., "Cache cleared" / "已清除快取")
  • Clear cache: avatar should re-download on next profile view
  • Clear cookies: next network call should re-authenticate automatically
  • Clear preferences: danger zone should hide (showDangerZone resets to false)
  • Clear user data: profile should show placeholder, pull-to-refresh should re-fetch

@rileychh-dokploy-riley-ntut-npc
Copy link

rileychh-dokploy-riley-ntut-npc bot commented Mar 5, 2026

Dokploy Preview Deployment

Name Status Preview Updated (UTC)
API Docs ✅ Done Preview URL 2026-03-10T14:04:16.922Z

@rileychh rileychh requested a review from Copilot March 5, 2026 16:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link

github-actions bot commented Mar 5, 2026

PR Preview Builds

Build Number: 605
Commit: 31b4705
Message: fix: delete cache directory contents instead of the directory itself

Deploy

  • Android (Firebase App Distribution)
  • iOS (TestFlight)

Android (Firebase App Distribution)

Install build 605

iOS (TestFlight)

  1. Open the TestFlight app on your iOS device
  2. Select "Project Tattoo"
  3. Install build 605

@rileychh rileychh requested a review from Copilot March 5, 2026 17:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rileychh added 3 commits March 9, 2026 15:44
Clear cache, cookies, preferences, and user data (database + secure
storage + cookies) with i18n support for both en and zh-TW.
Wrap the clear action in try/catch so filesystem, DB, or secure storage
errors show a failure snackbar instead of propagating unhandled.
@rileychh rileychh force-pushed the danger-zone-reset-options branch from 19d1762 to bca11fd Compare March 9, 2026 07:44
@bradly0cjw
Copy link
Member

tested on physical device

@bradly0cjw bradly0cjw enabled auto-merge March 10, 2026 14:28
Copy link
Contributor

@Dao-you Dao-you left a comment

Choose a reason for hiding this comment

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

Works on my machine

@bradly0cjw bradly0cjw merged commit add1c24 into main Mar 10, 2026
4 checks passed
@bradly0cjw bradly0cjw deleted the danger-zone-reset-options branch March 10, 2026 16:12
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.

4 participants