Commit Graph
29 Commits
Author SHA1 Message Date
google-labs-jules[bot]andPR0M3TH3AN 03f4efbfeb refactor(dm-db): use singleton IndexedDB connection to avoid N+1 overhead
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-08 03:41:19 +00:00
google-labs-jules[bot]andPR0M3TH3AN 596bfd074a chore(ai): remove dead code (agent)
Co-authored-by: PR0M3TH3AN <[email protected]>
2026-01-26 20:29:38 +00:00
thePR0M3TH3AN 6ec83e4237 update 2026-01-25 19:59:24 -05:00
google-labs-jules[bot] 1398d16e57 feat: enhance storage connection test with upload/retrieve/delete verification
- Expose PutObjectCommand and GetObjectCommand in s3-client.js
- Update testS3Connection in r2-s3.js to perform a full Read/Write/Delete cycle when a bucket is provided
- Add clear user-facing logs for each step of the storage test
2026-01-26 00:04:43 +00:00
thePR0M3TH3AN 999235d71e Add S3 storage option to upload modal 2026-01-24 20:00:00 -05:00
google-labs-jules[bot] 4a0b81ad98 chore(ai): remove dead code (unused exports & deps) 2026-01-24 20:28:53 +00:00
thePR0M3TH3AN 8e7dec4077 Add S3 public URL helpers 2026-01-24 13:16:26 -05:00
thePR0M3TH3AN e6ecbaf9e6 Add generic S3 multipart helpers 2026-01-23 20:02:15 -05:00
thePR0M3TH3AN 9412afb1af Add generic S3 client loader and update tests 2026-01-23 18:49:34 -05:00
google-labs-jules[bot] b285819145 fix(storage): resolve db connection leaks and patch test environment
- Added `db.close()` to exported functions in `js/storage/dmDb.js` to ensure IndexedDB connections are released.
- Patched `tests/test-helpers/setup-localstorage.mjs` to include a `structuredClone` polyfill required by `fake-indexeddb` in Node.js environments.
- Updated `tests/dm-normalization.test.mjs`, `tests/dm-db.test.mjs`, and `tests/nostr/dm-direct-message-flow.test.mjs` to conditionally initialize `fake-indexeddb` to prevent global conflicts.
- Verified fixes by running unit tests and the `scripts/agent/interop-test.mjs` E2E suite.
2026-01-19 16:24:07 +00:00
thePR0M3TH3AN ab286d2bb3 Add DM notification manager for seen state 2026-01-19 08:59:41 -05:00
thePR0M3TH3AN b05e898391 Add worker DM decrypt and persistence 2026-01-19 08:49:58 -05:00
thePR0M3TH3AN 56f2c1807c Implement worker-based NIP-04 DM sending 2026-01-19 08:39:43 -05:00
thePR0M3TH3AN f4672a0445 Add IndexedDB storage for DM data 2026-01-19 08:05:34 -05:00
google-labs-jules[bot] 35d3b0de73 Implement storage connection testing
Added `testConnection` to `StorageService` and `testS3Connection` to `r2-s3.js`.
Updated `ProfileModalController` to use the new `storageService.testAccess` method for verifying credentials before saving.
The test logic supports both specific bucket checks (via `HeadBucket`) and general credential checks (via `ListBuckets`).
2026-01-16 03:50:13 +00:00
google-labs-jules[bot] e51f21681b feat: make r2Service generic and integrate storageService 2026-01-16 02:58:36 +00:00
google-labs-jules[bot] fe1b6d0ae2 fix(storage): fix R2 setup issues (CORS, polyfills, headers)
- Switched to `esm.sh` bundle for `@aws-sdk/client-s3` to fix browser compatibility and `fs.readFile` errors.
- Removed `cf-create-bucket-if-missing` header from `multipartUpload` to prevent 403 Forbidden/CORS failures with standard API tokens.
- Refactored `verifyPublicAccess` to attempt CORS setup even if bucket check fails, and added specific error messaging for CORS issues.
- Updated documentation to include `POST` and `HEAD` in the recommended R2 CORS policy.
2026-01-14 17:11:04 +00:00
google-labs-jules[bot] 2758081a2f fix(storage): prevent r2 upload failure by removing restricted header
Removed the `cf-create-bucket-if-missing` header from the multipart upload request in `js/storage/r2-s3.js`. This header triggers a 403 Forbidden error (and subsequent "Failed to fetch" due to CORS behavior) when using R2 API tokens with limited "Object Read & Write" permissions, as it requires bucket creation privileges. Bucket existence is now handled separately.
2026-01-14 16:55:25 +00:00
google-labs-jules[bot] 857536c28f fix(storage): use esm.sh bundled aws-sdk to prevent fs error
Switched the CDN provider for the AWS SDK (R2 client) to the bundled version from `esm.sh` (`?bundle`). This resolves a runtime error `[unenv] fs.readFile is not implemented yet!` which occurred because the previous build was attempting to import Node.js-specific credential providers that rely on the filesystem.

The bundled version from `esm.sh` correctly resolves the browser entry points and provides browser-compatible polyfills (or safe defaults) for dependencies, ensuring the SDK initializes correctly in the client environment.

This change updates the `AWS_SDK_SPECIFIER` constant in `js/storage/r2-s3.js`.
2026-01-14 16:11:20 +00:00
google-labs-jules[bot] 4aa0021029 fix(storage): replace jsdelivr with esm.sh for aws-sdk
Switched the CDN provider for the AWS SDK (R2 client) from `jsdelivr` to `esm.sh` to resolve a runtime dependency error ("does not provide an export named 'blobHasher'"). This error was caused by a broken bundling of the transitive dependency `@smithy/hash-blob-browser` on `jsdelivr`.

This change updates the `AWS_SDK_SPECIFIER` constant in `js/storage/r2-s3.js`.
2026-01-14 15:48:30 +00:00
google-labs-jules[bot] a0ef54434a Implement 2-step wizard for R2 credentials with public access verification
- Added `deleteObject` to `js/storage/r2-s3.js` for cleanup.
- Added `verifyPublicAccess` to `js/services/r2Service.js` to test bucket configuration.
- Refactored `components/upload-modal.html` to support wizard steps.
- Updated `js/ui/components/UploadModal.js` to manage wizard state and trigger verification.
2026-01-12 20:16:30 +00:00
google-labs-jules[bot] 4345c8c7dd Fix export error in R2 storage module and refine upload workflow
- Exported `ensureBucketExists` from `js/storage/r2-s3.js` to resolve a module import error in `js/services/r2Service.js`.
- Verified the fix via code read.
- Confirmed syntax correctness of `r2-s3.js` modifications.
2026-01-12 19:49:48 +00:00
google-labs-jules[bot] c29a5c3bbe fix: switch to jsdelivr for external modules
Replaces unreliable esm.sh imports with cdn.jsdelivr.net to prevent site crashes due to CORS and timeout errors.
Updates imports for `nostr-tools`, `buffer`, and `@aws-sdk/client-s3` in `js/nostrToolsBootstrap.js`, `js/bufferPolyfill.js`, and `js/storage/r2-s3.js`.
Adds jsdelivr as a prioritized remote source in `nostrToolsBootstrap` while retaining esm.sh as a fallback.
2026-01-07 17:30:22 +00:00
thePR0M3TH3AN 99e8bd0c78 Fix modal zap flow tests and dependencies 2025-10-04 23:40:51 -04:00
thePR0M3TH3AN 1684c7070b Shorten bucket slugs and fix CORS refresh 2025-09-26 23:55:40 -04:00
thePR0M3TH3AN c32d2fce12 Ensure manual R2 buckets exist before applying CORS 2025-09-26 23:40:41 -04:00
thePR0M3TH3AN 46c2b39aae Ensure R2 CORS when using manual access keys 2025-09-26 22:58:13 -04:00
thePR0M3TH3AN 9da4e40ec9 Improve R2 auto-setup and multipart upload reliability 2025-09-26 21:51:22 -04:00
thePR0M3TH3AN 9b4dd2a6ff Add automated Cloudflare R2 bucket provisioning 2025-09-26 20:46:18 -04:00