diff --git a/.cursor/rules/development/development_guide.mdc b/.cursor/rules/development/development_guide.mdc index 092ffb98..a8065a31 100644 --- a/.cursor/rules/development/development_guide.mdc +++ b/.cursor/rules/development/development_guide.mdc @@ -4,7 +4,6 @@ alwaysApply: false --- ✅ use system date command to timestamp all interactions with accurate date and time -✅ python script files must always have a blank line at their end ✅ remove whitespace at the end of lines ✅ use npm run lint-fix to check for warnings ✅ do not use npm run dev let me handle running and supplying feedback @@ -22,12 +21,10 @@ alwaysApply: false - [ ] **Timestamp Usage**: Include accurate timestamps in all interactions - [ ] **Code Quality**: Use npm run lint-fix to check for warnings -- [ ] **File Standards**: Ensure Python files have blank line at end - [ ] **Whitespace**: Remove trailing whitespace from all lines ### After Development - [ ] **Linting Check**: Run npm run lint-fix to verify code quality -- [ ] **File Validation**: Confirm Python files end with blank line - [ ] **Whitespace Review**: Verify no trailing whitespace remains - [ ] **Documentation**: Update relevant documentation with changes diff --git a/package.json b/package.json index 9ca11deb..247a8044 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "timesafari", - "version": "1.1.0-beta", + "version": "1.1.1-beta", "description": "Time Safari Application", "author": { "name": "Time Safari Team" @@ -106,7 +106,7 @@ "guard": "bash ./scripts/build-arch-guard.sh", "guard:test": "bash ./scripts/build-arch-guard.sh --staged", "guard:setup": "npm run prepare && echo '✅ Build Architecture Guard is now active!'", - "clean:android": "./scripts/clean-android.sh", + "clean:android": "./scripts/uninstall-android.sh", "clean:ios": "rm -rf ios/App/build ios/App/Pods ios/App/output ios/App/App/public ios/DerivedData ios/capacitor-cordova-ios-plugins ios/App/App/capacitor.config.json ios/App/App/config.xml || true", "clean:electron": "./scripts/build-electron.sh --clean", "clean:all": "npm run clean:ios && npm run clean:android && npm run clean:electron", diff --git a/scripts/build-android.sh b/scripts/build-android.sh index 2d978712..b8c4669a 100755 --- a/scripts/build-android.sh +++ b/scripts/build-android.sh @@ -22,6 +22,7 @@ # --sync Sync Capacitor only # --assets Generate assets only # --deploy Deploy APK to connected device +# --uninstall Uninstall app from connected device # -h, --help Show this help message # -v, --verbose Enable verbose logging # @@ -196,6 +197,7 @@ SYNC_ONLY=false ASSETS_ONLY=false DEPLOY_APP=false AUTO_RUN=false +UNINSTALL=false CUSTOM_API_IP="" # Function to parse Android-specific arguments @@ -246,6 +248,9 @@ parse_android_args() { --auto-run) AUTO_RUN=true ;; + --uninstall) + UNINSTALL=true + ;; --api-ip) if [ $((i + 1)) -lt ${#args[@]} ]; then CUSTOM_API_IP="${args[$((i + 1))]}" @@ -291,6 +296,7 @@ print_android_usage() { echo " --assets Generate assets only" echo " --deploy Deploy APK to connected device" echo " --auto-run Auto-run app after build" + echo " --uninstall Uninstall app from connected device" echo " --api-ip Custom IP address for claim API (defaults to 10.0.2.2)" echo "" echo "Common Options:" @@ -305,6 +311,7 @@ print_android_usage() { echo " $0 --clean # Clean only" echo " $0 --sync # Sync only" echo " $0 --deploy # Build and deploy to device" + echo " $0 --uninstall # Uninstall app from device" echo " $0 --dev # Dev build with default 10.0.2.2" echo " $0 --dev --api-ip 192.168.1.100 # Dev build with custom API IP" echo "" @@ -417,8 +424,13 @@ safe_execute "Validating asset configuration" "npm run assets:validate" || { log_info "If you encounter build failures, please run 'npm install' first to ensure all dependencies are available." } -# Step 2: Clean Android app -safe_execute "Cleaning Android app" "npm run clean:android" || exit 1 +# Step 2: Uninstall Android app +if [ "$UNINSTALL" = true ]; then + log_info "Uninstall: uninstalling app from device" + safe_execute "Uninstalling Android app" "./scripts/uninstall-android.sh" || exit 1 + log_success "Uninstall completed successfully!" + exit 0 +fi # Step 3: Clean dist directory log_info "Cleaning dist directory..." diff --git a/scripts/clean-android.sh b/scripts/uninstall-android.sh similarity index 94% rename from scripts/clean-android.sh rename to scripts/uninstall-android.sh index 4fa354af..37071829 100755 --- a/scripts/clean-android.sh +++ b/scripts/uninstall-android.sh @@ -1,8 +1,8 @@ #!/bin/bash -# clean-android.sh +# uninstall-android.sh # Author: Matthew Raymer # Date: 2025-08-19 -# Description: Clean Android app with timeout protection to prevent hanging +# Description: Uninstall Android app with timeout protection to prevent hanging # This script safely uninstalls the TimeSafari app from connected Android devices # with a 30-second timeout to prevent indefinite hanging. diff --git a/src/db-sql/migration.ts b/src/db-sql/migration.ts index 05b99da9..5ee221f5 100644 --- a/src/db-sql/migration.ts +++ b/src/db-sql/migration.ts @@ -71,10 +71,8 @@ const MIG_004_SQL = ` -- CLEANUP: Remove orphaned settings records and clear legacy activeDid values -- This completes the migration from settings-based to table-based active identity -- Use guarded operations to prevent accidental data loss - DELETE FROM settings WHERE accountDid IS NULL AND id != 1; - UPDATE settings SET activeDid = NULL WHERE id = 1 AND EXISTS ( - SELECT 1 FROM active_identity WHERE id = 1 AND activeDid IS NOT NULL - ); + DELETE FROM settings WHERE accountDid IS NULL; + UPDATE settings SET activeDid = NULL; `; // Each migration can include multiple SQL statements (with semicolons)