Commit Graph
1982 Commits
Author SHA1 Message Date
Jose Olarte III 69abb67ea0 Better error handling for image upload 2025-05-28 16:17:49 +08:00
Matthew Raymer 7ff9ef04ae fix(db): add type declarations for SQL.js and absurd-sql modules
- Create type declarations in interfaces/absurd-sql.d.ts
- Import and use proper QueryExecResult and SqlValue types
- Add declarations for all required modules:
  - @jlongster/sql.js
  - absurd-sql
  - absurd-sql/dist/indexeddb-backend
  - absurd-sql/dist/indexeddb-main-thread
- Ensure type safety for database operations

This change resolves TypeScript errors about missing type declarations
while maintaining proper type safety for database operations. The
declarations are placed in the interfaces folder to match the project's
type organization.
2025-05-28 06:21:20 +00:00
Matthew Raymer 7cab40f7f2 fix(db): improve type safety in AbsurdSqlDatabaseService
- Move external module type declarations to dedicated .d.ts file
- Make SQL.js types compatible with our database interface
- Fix type compatibility between operation queue and database results
- Add proper typing for database operations and results

This change improves type safety by:
1. Properly declaring types for external modules
2. Ensuring database operation results match our interface
3. Making the operation queue type-safe with generics
4. Removing duplicate type definitions

The remaining module resolution warnings can be safely ignored as they
don't affect runtime behavior and our type declarations are working.
2025-05-28 06:07:50 +00:00
Matthew Raymer d4998395a1 fix(db): resolve type compatibility in AbsurdSqlDatabaseService
- Make QueuedOperation interface generic to properly handle operation types
- Fix type compatibility between queue operations and their resolvers
- Use explicit typing for operation queue to handle generic types
- Maintain type safety while allowing different operation return types

This fixes a TypeScript error where the operation queue's resolve function
was not properly typed to handle generic return types from database operations.
2025-05-28 06:02:55 +00:00
Matthew Raymer 2060553340 feat(capacitor): implement storage permission checks for file operations
- Add permission checks before writeFile and writeAndShareFile operations
- Reuse existing checkStoragePermissions method for Android devices
- Maintain iOS-specific handling (early return for iOS permission model)
- Improve error handling and logging for permission-related issues

This change ensures proper storage permission handling on Android devices
while maintaining the existing iOS behavior. The permission checks run
before any file write operations, providing better error handling and
user experience.
2025-05-28 05:56:58 +00:00
Matthew Raymer 8749f1d0a8 fix: placeholder for PyWebViewPlatformService writeAndShareFile 2025-05-28 05:06:31 +00:00
trentlarson fca019fb2e fix spelling of SQLite module for iOS 2025-05-27 21:11:07 -06:00
trentlarson 8092d1c576 convert all remaining DB writes & reads to SQL (with successful registration & claim) 2025-05-27 21:07:24 -06:00
Matthew Raymer f0d8fdf98c WIP: disabling absurd-sql when using Capacitor SQLite 2025-05-27 13:15:41 +00:00
Matthew Raymer 7b4f9d6556 fix: add requirements for capacitor/sqlite 2025-05-27 12:42:27 +00:00
Matthew Raymer b04a66179a feature: fleshed out capacitor and electron database operators 2025-05-27 11:23:52 +00:00
Jose Olarte III a9a0f1e891 TEST: platform- and camera-specific mirroring 2025-05-27 18:58:35 +08:00
Jose Olarte III c128aa1ce0 Streamlined QR scanner web camera
- No need to stop and start camera preview
2025-05-27 18:57:12 +08:00
Jose Olarte III bacf1ef98f Mobile native to use web camera
- Ensure consistent UI experience for uploading photos across mobile web and native
2025-05-27 17:46:19 +08:00
Jose Olarte III 033ef2297d Feature: context-based default camera
- Specify the default camera (front / back) to use
2025-05-27 15:37:45 +08:00
trentlarson 3f691ef880 add SQL DB access to everywhere we are using the DB, up to the "C" files 2025-05-27 01:27:04 -06:00
Matthew Raymer 3428f9e6ab fix: resolve PWA build issues with SQL.js worker files
- Update worker format to ESM in Vite config to fix IIFE format error

- Increase PWA precache file size limit to 10MB to accommodate SQL.js files

- Fix type declarations for worker configuration

- Add proper type annotations for Vite config

- Add type declarations for absurd-sql module
2025-05-27 06:54:29 +00:00
trentlarson 2d654b4586 fix linting 2025-05-26 22:56:00 -06:00
Matthew Raymer 5f06611257 fix: update ESLint and VS Code settings
- Configure ESLint to ignore node_modules
- Add VS Code settings for Java diagnostics

This fixes the Android build issues and improves the development
environment by properly ignoring node_modules in linting and
diagnostics.
2025-05-27 04:43:52 +00:00
trentlarson fe77dbdcdd add encryption & decryption for the sensitive identity & mnemonic in SQL DB 2025-05-26 22:42:20 -06:00
Matthew Raymer 4d35760a65 fix: move lexical declarations outside case blocks
fix: missing logger import
Move variable declarations outside switch statement in AbsurdSqlDatabaseService
to fix 'no-case-declarations' linter errors.
2025-05-27 03:21:55 +00:00
Matthew Raymer dac7705003 fix: move lexical declarations outside case blocks in AbsurdSqlDatabaseService
- Move queryResult and allResult declarations outside switch statement
- Change const declarations to let since they're now in outer scope
- Remove const declarations from inside case blocks

This fixes the 'no-case-declarations' linter errors by ensuring variables
are declared in a scope that encompasses all case blocks, preventing
potential scoping issues.

Note: Type definition errors for external modules remain and should be
addressed separately.
2025-05-27 03:14:02 +00:00
trentlarson 7cc35803c9 remove debugging console statements 2025-05-26 20:43:06 -06:00
trentlarson 84cc501951 start adding the SQL approach to files, also using the Dexie approach if desired 2025-05-26 20:26:28 -06:00
trentlarson 3f46e3817a add encryption for the two SQL columns, replace basic DB utils, add USE_DEXIE_DB flag, and start adding SQL everywhere 2025-05-26 19:03:20 -06:00
trentlarson 6e005de65a remove unused redirect to start page (now that we're creating an ID up front) 2025-05-26 16:29:10 -06:00
trentlarson 611fa232da add queueing to the DB service so that requests get processed in order 2025-05-26 16:28:33 -06:00
trentlarson 8fb49f5279 remove possibility of failing a migration script and then succeeding on later ones 2025-05-26 15:50:37 -06:00
trentlarson c1d730f586 fix console error about "window" unavailable due to service worker 2025-05-26 15:49:44 -06:00
trentlarson f0c947ba07 rename the absurd-sql-specific items for clarity 2025-05-26 14:52:39 -06:00
trentlarson 0e10847cba adjust so DB calls go to the factory 2025-05-26 13:59:34 -06:00
Jose Olarte III aeb771f619 Linting 2025-05-26 19:23:41 +08:00
Jose Olarte III cb82846593 Feature: front/back camera toggle
- Added to gifting and profile dialog camera for now. Toggle button is hidden in desktop.
- WIP: same feature for QR scanner camera.
- WIP: ability to specify default camera depending on where it's called.
2025-05-26 19:23:28 +08:00
trentlarson bb0d8942b8 fix migrations logging error 2025-05-25 21:52:27 -06:00
Matt Raymer 8b734e4ffb Merge remote-tracking branch 'refs/remotes/origin/sql-absurd-sql' into sql-absurd-sql 2025-05-25 23:37:43 -04:00
Matt Raymer 152499a34f refactor: improve type safety and browser compatibility - Replace any types with SqlValue[] in migration system - Add browser-compatible implementations of Node.js modules (crypto, fs, path) - Update Vite config to handle Node.js module polyfills - Remove outdated migration documentation files 2025-05-25 23:37:08 -04:00
trentlarson 4500ab5038 fix BUILDING instructions 2025-05-25 21:29:57 -06:00
Matt Raymer 9492018fd6 refactor(db): improve type safety in migration system
- Replace any[] with SqlValue[] type for SQL parameters in runMigrations
- Update import to use QueryExecResult from interfaces/database
- Add proper typing for SQL parameter values (string | number | null | Uint8Array)

This change improves type safety and helps catch potential SQL parameter
type mismatches at compile time, reducing the risk of runtime errors
or data corruption.
2025-05-25 23:09:53 -04:00
Matt Raymer fe1e198992 chore: update migration documents and move to new home 2025-05-25 22:50:32 -04:00
Matt Raymer dda1e763d1 Merge remote-tracking branch 'refs/remotes/origin/sql-absurd-sql' into sql-absurd-sql 2025-05-25 22:47:36 -04:00
trentlarson 17727a3ff7 add to build instructions for electron on mac 2025-05-25 20:48:51 -06:00
trentlarson 26fba66bba fix linting 2025-05-25 20:48:33 -06:00
trentlarson d6f9567777 don't always apply the camera-implementation cursor rules 2025-05-25 20:37:16 -06:00
trentlarson 28b24f6c5d add a input area for arbitrary SQL on the test page 2025-05-25 20:27:06 -06:00
Matt Raymer 1f82a5b328 Merge branch 'new-storage' into sql-absurd-sql 2025-05-25 22:25:56 -04:00
trentlarson bea5f78171 fix problems with race conditions and multiple DatabaseService instances 2025-05-25 19:46:15 -06:00
trentlarson d4b01e0cbf fix problem with initialization & refactor types 2025-05-25 18:32:41 -06:00
trentlarson 60be32e120 add more to the inital migration, and refactor the locations of types 2025-05-25 17:55:04 -06:00
trentlarson b597b17eec remove unused setting 2025-05-25 15:49:36 -06:00
trentlarson c14c2d173e add DB setup with migrations 2025-05-25 11:06:30 -06:00