- Replace console.log with structured logger.debug() calls in AmountInput,
GiftDetailsStep, and GiftedDialog components
- Fix duplicate enum values in constants/app.ts for LOCAL_*_API_SERVER
- Replace Record<string, any> with Record<string, string> for query params
- Update error handling from catch(err: any) to catch(err: unknown)
- Add EntityData interface and fix entity prop typing
- Remove USE_DEXIE_DB conditionals and unused database imports
- Fix duplicate imports and class members in GiftedDialog.vue
- Correct createAndSubmitGive function call parameters
Resolves 12 linting errors and 9 TypeScript any type warnings.
Improves type safety, logging practices, and removes deprecated code.
- Replace Record<string, any> with Record<string, string> for query params
- Fix error handling from catch(err: any) to catch(err: unknown)
- Add EntityData interface for proper entity typing
- Update EntitySelectionEvent interface with union types
- Remove USE_DEXIE_DB conditionals and unused import
- Clean up database service calls removing Dexie fallbacks
Resolves 9 TypeScript any type warnings, improves type safety across
entity selection components, and removes deprecated database migration code.
Remove CORS headers to enable universal image support and fix local API server settings.
## Changes
**Remove CORS Headers**
- Remove Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers
- Enables images from any domain (Facebook, Medium, arbitrary websites)
- Database falls back to IndexedDB mode (minimal performance impact)
**Fix Local Development Configuration**
- Set LOCAL_ENDORSER_API_SERVER to http://127.0.0.1:3000 (was "/api")
- Create .env.development with local API server config
- Fix ensureCorrectApiServer() method in HomeView.vue
- "Use Local" button now sets proper localhost address
**Fix Settings Cache Issues**
- Add PlatformServiceMixin to AccountViewView.vue
- Disable settings caching to prevent stale data
- Settings changes now apply immediately without browser refresh
## Impact
**Tradeoffs:**
- Lost: ~2x SharedArrayBuffer database performance
- Gained: Universal image support from any domain
- Result: Better user experience, database still fast via IndexedDB
**Files Modified:**
- Configuration: vite.config.*.mts, index.html, .env.development
- Source: constants/app.ts, libs/util.ts, views/*.vue, utils/PlatformServiceMixin.ts
## Rationale
For a community platform, universal image support is more critical than marginal
database performance gains. Users share images from arbitrary websites, making
CORS restrictions incompatible with Time Safari's core mission.
- Replace any type assertions with proper type definitions
- Add null safety with fallback values for undefined fields
- Improve error handling with type-safe string assignments
- Use JSON.stringify for non-string error objects
- Maintain runtime compatibility while improving type safety
Files changed:
- src/views/DIDView.vue: Fix claim type assertions and error handling
- src/views/ContactsView.vue: Fix registration payload and catch block typing
- Fix remaining type warnings by specifying Settings for cache and using this._setCached directly
- Add eslint-disable-next-line comments for unavoidable (this as any) usages required for Vue context access
- All @typescript-eslint/no-explicit-any warnings are now suppressed or resolved
- Lint passes with zero warnings or errors
- No functional changes; improves code clarity and developer experience
- Replace all `any` types in IPlatformServiceMixin and ComponentCustomProperties with proper types:
- Use PlatformCapabilities for capabilities
- Use QueryExecResult, DatabaseExecResult, and generics for database methods
- Use Contact[] and Settings for contact and settings methods
- Improves IDE type inference and type safety for all consumers of the mixin
- No functional changes, interface/type declarations only
- Add proper return types for database methods: QueryExecResult, DatabaseExecResult, Contact[]
- Improve cache system typing with VueComponentWithMixin interface and CacheEntry<unknown>
- Fix $refreshContacts() return type from Promise<any[]> to Promise<Contact[]>
- Update database interfaces with DatabaseExecResult and generic DatabaseResult types
- Maintain runtime compatibility by keeping necessary (this as any) for Vue component context
- Reduces TypeScript warnings from 81 to 23 while preserving all functionality
- Improves type safety for database operations, caching, and contact management
- Replace WeakMap<any, Map<string, CacheEntry<any>>> with proper VueComponentWithMixin interface
- Add VueComponentWithMixin interface with _platformService, $options, activeDid, and platformService() method
- Use CacheEntry<unknown> instead of CacheEntry<any> for better type safety
- Replace (this as any) with (this as unknown as VueComponentWithMixin) for safer type assertions
- Reduces TypeScript warnings from 53 to 29 (24 warnings eliminated)
- Maintains all existing functionality while improving type safety
- Replace all `any` types in $db, $exec, $one, $query, $first, and $contacts with proper interfaces:
- Use QueryExecResult and DatabaseExecResult for raw database operations
- Use Contact[] for contact queries
- Add generics for mapped query results
- Update PlatformService and database interfaces to match new types
- Remove unused type imports and fix linter errors
- Reduces risk of runtime errors and improves type safety for all database access
- Fix EntityIcon.vue to import blank-square.svg as module instead of using relative path
- Update template to use imported SVG path for proper Electron compatibility
- Make contact prop optional in EntityIcon component to fix TypeScript error
- Add proper Settings type imports and method signatures in PlatformServiceMixin.ts
- Replace console statements with logger calls across multiple files
- Resolves SVG loading failures in Electron builds while maintaining web compatibility
- Reduces TypeScript 'any' type warnings from 81 to 53
- Add initialization phase detection to logger (2-second delay)
- Prevent database logging during critical startup phase
- Use console logging for critical startup messages to avoid circular dependency
- Add manual initialization control functions (markInitializationComplete, isInitializationPhase)
- Filter initialization-related messages from database logging
Files modified:
- src/utils/logger.ts: Add initialization state tracking and filtering
- src/registerSQLWorker.js: Use console for critical startup message
- src/services/PlatformServiceFactory.ts: Use console for singleton creation message
- src/services/platforms/WebPlatformService.ts: Use console for worker context message
Resolves circular dependency where logging tried to access database during platform service initialization, causing infinite loops with [DB-PREVENTED-INFO] messages.
- Reduce migration/platform logging verbosity in development mode (~80-90% less noise)
- Fix AbsurdSQL platform check to support 'development' alongside 'web'
- Add missing WebPlatformService methods (isWorker, initSharedArrayBuffer)
- Fix Electron API endpoint resolution to prevent JSON parsing errors
- Prevent circular database logging that caused [DB-PREVENTED-INFO] spam
Console now shows only essential information while preserving all errors/warnings
fix: eliminate SharedArrayBuffer checks on non-web platforms
* Add platform guard in AbsurdSqlDatabaseService to only initialize on web
* Change singleton pattern from eager to lazy instantiation
* Update worker import to use lazy singleton pattern
* Prevents absurd-sql initialization on Electron/Capacitor platforms
* Reduces console noise and memory footprint on desktop/mobile
* Maintains full web platform functionality and performance
Resolves SharedArrayBuffer-related console output on Electron platform
while preserving all web features and maintaining clean architecture.
- Applied transformImageUrlForCors to all image-displaying components
- Added followRedirects: true to image proxy to serve actual content
- Proxy now returns 200 OK with image data instead of 301 redirects
- Maintains CORS headers required for SharedArrayBuffer support
- Added debug logging for proxy response monitoring
Resolves all image loading failures in development environment.
- Convert MASTER_SETTINGS_KEY from number to string to match method signatures
- Resolves TypeScript errors in PlatformServiceMixin.ts lines 462 & 490
- Maintains backward compatibility with existing database records
- Build verification passed successfully
- TopMessage: Replace 50+ lines of settings logic with single () call
- HomeView: Replace databaseUtil calls with () and ()
- Remove unused imports (MASTER_SETTINGS_KEY, databaseUtil) from HomeView
- Settings updates now use automatic cache invalidation for performance
- Reduce settings boilerplate by 80-90% with cached shortcuts
- Add (), (), () for shortest possible database calls
- Add (), () for query+mapping combinations
- Add (), (), () specialized shortcuts
- Apply TypeScript declaration merging to eliminate type assertions
- Reduce HomeView database calls from 3 lines to 1 line (64% reduction)
- Convert settings loading from 6 lines to 4 lines (44% reduction)
- Replace all (this as any) type assertions with proper typing
- Remove duplicate property declarations from TopMessage component
- Use (this as any) type assertion for mixin methods
- Resolves 'Data property already defined' warnings
- Fixes 'this.dbQuery is not a function' runtime errors
- Implement worker-only database access to eliminate double migrations
- Add parameter serialization in usePlatformService to prevent Capacitor "object could not be cloned" errors
- Fix infinite logging loop with circuit breaker in databaseUtil
- Use dynamic imports in WebPlatformService to prevent worker thread errors
- Add higher-level database methods (getContacts, getSettings) to composable
- Eliminate Vue Proxy objects through JSON serialization and Object.freeze protection
Resolves Proxy(Array) serialization failures and worker context conflicts across Web/Capacitor/Electron platforms.
- Change Android Gradle Plugin from 8.10.1 to 8.9.1
- Resolves compatibility issue with Android Studio
- Maintains compatibility with Gradle 8.11.1 wrapper
Author: Matthew Raymer
SECURITY AUDIT CHECKLIST:
- [x] No security implications from AGP version change
- [x] Version downgrade is to stable, supported version
- [x] Build process remains secure and functional
* Create scripts/build-ios.sh with comprehensive build automation
* Handle pkgx Ruby/Gem environment configuration issues
* Support command-line version and build number updates
* Add environment validation for macOS and Xcode requirements
* Update BUILDING.md with automated build script documentation
- Replace 'any' type assertions with specific types in migration name extraction
* Change '(row as any).name' to '(row as { name: string }).name'
* Add proper null checks and 'in' operator for property access
- Fix database integrity check type safety
* Change '(col: any)' to '(col: unknown)' with type guards
* Use specific type assertion for column name checking
Resolves: @typescript-eslint/no-explicit-any warnings (2 instances)
Impact: Improves type safety without changing functionality
- Fix logToDb() to use actual database schema: 'date' and 'message' columns
- Change INSERT query from non-existent 'timestamp, level' to existing 'date, message'
- Change DELETE cleanup to use 'date' column instead of 'timestamp'
- Embed log level in message text as '[LEVEL] message' instead of separate column
- Use toDateString() format to match schema instead of toISOString()
Resolves: "table logs has no column named timestamp" infinite error loop
Critical: Enables Electron app initialization by matching code to existing schema
Impact: Stops database logging from crashing and allows normal app startup
- Add comprehensive IndexedDB to SQLite migration service (1,397 lines)
- Create migration UI with progress tracking and validation (1,492 lines)
- Fix Electron TypeScript compilation and SQLite plugin issues
- Expand migration system with detailed documentation and error handling
- Add development guide and coding standards
Resolves: #electron-startup #database-migration #typescript-errors
Impact: Enables user-friendly database migration with full data verification
- Temporarily disable log inserts to break error loop and reveal underlying issues
- Fix secret table column mismatch: use 'secretBase64' for new schema, matching code expectations
- Add migration for correct secret table column
- Add rich comments and TODOs for future schema/code alignment
Author: Matthew Raymer
SECURITY AUDIT CHECKLIST:
- [x] No sensitive data exposed in logs
- [x] Database schema and code now consistent for secrets/logs/settings
- [x] No direct client exposure of secrets
- [x] Logging disabled to prevent error amplification
- [x] All changes reviewed for privacy and data integrity
- Add detailed file-level documentation with architecture overview and usage examples
- Document all interfaces, classes, and methods with JSDoc comments
- Include migration philosophy, best practices, and schema evolution guidelines
- Add extensive inline documentation for database schema and table purposes
- Document privacy and security considerations in database design
- Provide troubleshooting guidance and logging explanations
- Add template and examples for future migration development
- Include platform-specific documentation for Capacitor SQLite integration
- Document validation and integrity checking processes with detailed steps
The migration system is now thoroughly documented for maintainability and
onboarding of new developers to the codebase.
- Add multi-layered migration validation strategy with schema detection
- Implement database integrity checker that validates all core tables and columns
- Add schema-based migration skipping to prevent re-running applied migrations
- Enhanced error handling for duplicate table/column scenarios with validation
- Add comprehensive logging for migration tracking and database state verification
- Include final validation step to ensure all migrations are properly recorded
The system now properly:
1. Checks if migrations are recorded in the migrations table
2. Validates actual schema exists before attempting to apply migrations
3. Handles edge cases where schema exists but isn't recorded
4. Provides detailed integrity checking of database structure
5. Eliminates SQL errors from duplicate table/column creation attempts
Migration tracking is now working correctly with both migrations properly recorded.
- Root cause: Migration names were not being properly inserted into migrations table
- Fixed parameter binding in Capacitor platform service migration functions
- Added detailed debugging to track SQL execution and parameter passing
- Reverted migrations back to proper form (without IF NOT EXISTS workarounds)
- Enhanced extractMigrationNames to handle Capacitor SQLite result format
The migration system should now properly track applied migrations and avoid
re-running them on subsequent app starts.
- Add comprehensive console logging for Electron with emojis for better visibility
- Use CREATE TABLE IF NOT EXISTS and INSERT OR IGNORE to prevent duplicate creation errors
- Add specialized column existence checking for ALTER TABLE ADD COLUMN operations
- Improve migration tracking with detailed status reporting (applied/skipped counts)
- Add proper error handling for existing schema scenarios
- Enhanced documentation and type safety for migration system
This resolves issues where migrations would fail with 'table already exists' or
'duplicate column' errors when the database schema was already properly set up.
The enhanced logging makes it clear to users when migrations are being skipped
vs. applied, improving the debugging experience in Electron.
- Create build-electron.sh script following build-android.sh patterns
- Add support for multiple build modes: dev, package, appimage, deb
- Implement comprehensive error handling with specific exit codes
- Add proper logging and step-by-step build process tracking
- Include built-in help system and verbose logging options
Build Script Features:
- Development builds that compile and launch Electron app
- Package builds for creating distributable applications
- Support for AppImage and Debian package generation
- Automatic cleanup of previous builds and artifacts
- TypeScript compilation with proper error handling
- Capacitor sync and asset generation integration
NPM Script Integration:
- Add build:electron for development builds
- Add build:electron:package for distributable packages
- Add build:electron:appimage for AppImage packages
- Add build:electron:deb for Debian packages
- Add clean:electron for build artifact cleanup
Common Utilities Enhancement:
- Extend setup_build_env() to support 'electron' build type
- Configure proper environment variables for Electron builds
- Maintain consistency with existing build infrastructure
This provides a complete, automated build solution for Electron
that matches the quality and functionality of the Android build
system, enabling reliable cross-platform desktop application builds.
- Create build-electron.sh script following build-android.sh patterns
- Add support for multiple build modes: dev, package, appimage, deb
- Implement comprehensive error handling with specific exit codes
- Add proper logging and step-by-step build process tracking
- Include built-in help system and verbose logging options
Build Script Features:
- Development builds that compile and launch Electron app
- Package builds for creating distributable applications
- Support for AppImage and Debian package generation
- Automatic cleanup of previous builds and artifacts
- TypeScript compilation with proper error handling
- Capacitor sync and asset generation integration
NPM Script Integration:
- Add build:electron for development builds
- Add build:electron:package for distributable packages
- Add build:electron:appimage for AppImage packages
- Add build:electron:deb for Debian packages
- Add clean:electron for build artifact cleanup
Common Utilities Enhancement:
- Extend setup_build_env() to support 'electron' build type
- Configure proper environment variables for Electron builds
- Maintain consistency with existing build infrastructure
This provides a complete, automated build solution for Electron
that matches the quality and functionality of the Android build
system, enabling reliable cross-platform desktop application builds.
- Enhanced migration service error handling and logging
- Added better recovery mechanisms for failed migrations
- Improved database state validation before migration execution
- Added comprehensive error reporting in migration service
- Updated HomeView to handle migration errors gracefully
- Fixed database initialization sequence to prevent constraint violations
This addresses UNIQUE constraint failed errors during app startup
and provides better user feedback during database migration issues.
- Added custom error handler for electron-unhandled to suppress EPIPE errors
- Added process.stdout and process.stderr error handlers for EPIPE
- EPIPE errors are common in AppImages due to console output pipe issues
- App now runs cleanly without unhandled error dialogs
Resolves console output errors that were causing unhandled error dialogs
in the distributed AppImage while maintaining proper error logging for
other types of errors.