From 8724f8bbe0161ee86339177e46d8d3db7aaa77f3 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Tue, 19 Aug 2025 03:41:30 +0000 Subject: [PATCH] fix: resolve CHANGELOG version mismatch and Android clean hanging issue - Fix CHANGELOG.md version from [1.0.7] to [1.0.8-beta] to match package.json - Replace problematic clean:android npm script with robust clean-android.sh script - Add timeout protection (30s) to prevent adb commands from hanging indefinitely - Include cross-platform timeout fallback using perl for macOS compatibility - Improve logging and error handling for Android cleanup process Fixes team member reported issues: - CHANGELOG version inconsistency - clean:android getting stuck during execution --- CHANGELOG.md | 2 +- package.json | 2 +- scripts/clean-android.sh | 62 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100755 scripts/clean-android.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 19209fb6..3c8febc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.7] - 2025.08.18 +## [1.0.8-beta] - 2025.08.18 ### Fixed - Deep link for onboard-meeting-members diff --git a/package.json b/package.json index e0548c68..cfe759b1 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "build:electron:dmg:dev": "./scripts/build-electron.sh --dev --dmg", "build:electron:dmg:test": "./scripts/build-electron.sh --test --dmg", "build:electron:dmg:prod": "./scripts/build-electron.sh --prod --dmg", - "clean:android": "adb uninstall app.timesafari.app || true", + "clean:android": "./scripts/clean-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/clean-android.sh b/scripts/clean-android.sh new file mode 100755 index 00000000..4fa354af --- /dev/null +++ b/scripts/clean-android.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# clean-android.sh +# Author: Matthew Raymer +# Date: 2025-08-19 +# Description: Clean 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. + +# Exit on any error +set -e + +# Source common utilities +source "$(dirname "$0")/common.sh" + +# Function to implement timeout for systems without timeout command +timeout_command() { + local timeout_seconds="$1" + shift + + # Check if timeout command exists + if command -v timeout &> /dev/null; then + timeout "$timeout_seconds" "$@" + else + # Fallback for systems without timeout (like macOS) + # Use perl to implement timeout + perl -e ' + eval { + local $SIG{ALRM} = sub { die "timeout" }; + alarm shift; + system @ARGV; + alarm 0; + }; + if ($@) { exit 1; } + ' "$timeout_seconds" "$@" + fi +} + +log_info "Starting Android cleanup process..." + +# Check if adb is available +if ! command -v adb &> /dev/null; then + log_error "adb command not found. Please install Android SDK Platform Tools." + exit 1 +fi + +# Check for connected devices +log_info "Checking for connected Android devices..." +if adb devices | grep -q 'device$'; then + log_info "Android device(s) found. Attempting to uninstall app..." + + # Try to uninstall with timeout + if timeout_command 30 adb uninstall app.timesafari.app; then + log_success "Successfully uninstalled TimeSafari app" + else + log_warn "Uninstall failed or timed out after 30 seconds" + log_info "This is normal if the app wasn't installed or device is unresponsive" + fi +else + log_info "No Android devices connected. Skipping uninstall." +fi + +log_success "Android cleanup process completed"