Skip to content

WIP: Storacha chnages to check if all changes in next is intact#752

Draft
prathieshna wants to merge 114 commits intonextfrom
feature/storacha
Draft

WIP: Storacha chnages to check if all changes in next is intact#752
prathieshna wants to merge 114 commits intonextfrom
feature/storacha

Conversation

@prathieshna
Copy link

No description provided.

prathieshna and others added 30 commits May 29, 2025 18:07
# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/net/opendasharchive/openarchive/SaveApp.kt
#	app/src/main/res/values/strings.xml
#	gradle/libs.versions.toml
This commit applies edge-to-edge insets to the "Add" button in `StorachaMediaFragment` and the "Continue" button in `StorachaClientQRFragment` to ensure they are displayed correctly with navigation bars.

Additionally, the following dependencies were updated:
- AGP to 8.12.1
- Core KTX to 1.17.0
- Kotlin to 2.2.10
- KSP to 2.2.10-2.0.2
- Material3 to 1.4.0-beta02
This commit updates `StorachaAccountDetailsFragment` to apply window insets for edge-to-edge display. Specifically, it applies bottom insets to the `buttonBar` to accommodate navigation bars.
# Conflicts:
#	app/src/main/java/net/opendasharchive/openarchive/features/settings/SpaceSetupFragment.kt
#	app/src/main/res/navigation/space_setup_navigation.xml
#	gradle/libs.versions.toml
Prathieshna Vekneswaran added 16 commits November 25, 2025 15:32
Bringing in latest changes from next branch including:
- Media list viewholder improvements for upload and preview screens
- Camera screen enhancements with video recording timer
- PDF thumbnail generation and display
- WebDAV screen refactoring with Jetpack Compose
- UI improvements for media grids in selection mode
Resolved conflicts in:
- app/build.gradle.kts
- app/src/main/java/net/opendasharchive/openarchive/features/media/camera/CameraConfig.kt
- app/src/main/res/values/strings.xml
Cleaned up CameraConfig.kt by removing trailing commas.
Added Picasso and Jsoup to the project dependencies.
Updated app version from 4.0.4 to 4.0.9 and adjusted the version code.
Escaped apostrophes in several Ukrainian translation strings to fix rendering issues.
Removed a duplicated `web_dav_host_error` string and corrected a malformed CDATA tag in the Turkish translation file.
# Conflicts:
#	app/build.gradle.kts
#	app/src/main/java/net/opendasharchive/openarchive/SaveApp.kt
#	app/src/main/java/net/opendasharchive/openarchive/features/core/BaseFragment.kt
#	app/src/main/res/values-uk/strings.xml
   Resolved conflicts:
   - Space.kt: Kept STORACHA enum entry and updated RAVEN naming
   - BaseFragment.kt: Kept storacha-related imports for session management
   - MainActivity.kt: Merged DWeb groups and Storacha checks in menu logic
   - SpaceSetupFragment.kt: Kept navigation approach with Storacha callback
   - app_nav_graph.xml: Added Storacha navigation actions only (Snowbird migrated)
   - strings.xml: Kept all Storacha strings and Sync Preferences
   - libs.versions.toml: Updated zxing library versions and naming
Refactored the Snowbird feature to launch in a separate `SnowbirdActivity` instead of a fragment within the main navigation graph.

- Modified `SpaceSetupFragment` to start `SnowbirdActivity` via an intent, decoupling it from the main `NavGraph`.
- Removed unused ZXing dependencies from `gradle/libs.versions.toml`.
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

detekt found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Prathieshna Vekneswaran and others added 13 commits January 8, 2026 23:25
…reads

- Migrated file I/O operations and CAR file generation in `StorachaMediaFragment` to coroutines using `lifecycleScope.launch` and `Dispatchers.IO`.
- Improved error handling in `handleMedia` by catching specific exceptions and providing user-friendly error messages.
- Updated retry logic in `retryFailedUpload` to perform file cleanup and regeneration off the main thread.
- Bumped `versionCode` to 30028 and `versionName` to 4.0.5.
… Storacha uploads

Updated the Storacha upload and metadata fetching logic to better handle direct file access and preserve original filenames via UnixFS directory wrapping.

- **Enhanced Metadata Fetching:**
    - Implemented a `HEAD` request check in `FileMetadataFetcher` to handle direct file URLs (non-HTML directory listings).
    - Added logic to extract filenames from `Content-Disposition` headers and fallback to truncated CIDs.
    - Added MIME type detection and human-readable file size formatting.
- **Upload Improvements:**
    - Updated `StorachaApiService` and `BridgeUploader` to accept and send the original `fileName` to the backend.
    - Modified `StorachaMediaViewModel` and `StorachaMediaFragment` to capture and pass the original filename during the upload process.
    - The backend now uses the provided filename to wrap uploads in a UnixFS directory structure, improving file identification on IPFS gateways.
- **Robustness:**
    - Improved CID extraction from various gateway URL formats (path-based and subdomain-based).
    - Updated retry logic to persist original filenames for failed uploads.
This commit introduces significant improvements to the file upload process for better performance and user experience. It implements optimistic updates, robust retry logic, and prevents memory issues with large files.

- **Optimistic UI for Uploads:**
    - New uploads now appear in the media list immediately, providing instant user feedback without waiting for server confirmation.
    - A silent background sync follows to ensure data consistency without blocking the UI.

- **Robust Uploads with Retries:**
    - Implemented a retry mechanism for file uploads (`uploadWithRetry`).
    - The system now automatically retries uploads up to 3 times on transient network errors (`IOException`) or 5xx server errors, with exponential backoff.

- **Memory Optimization:**
    - Created a dedicated `OkHttpClient` (`uploadClient`) for file transfers that omits the logging interceptor, preventing `OutOfMemoryError` when uploading large files.
    - The default API client's logging level was changed from `BODY` to `HEADERS` to avoid logging large request/response bodies.

- **UI State Handling:**
    - Improved loading and error state management to prevent showing an "empty" screen if a background refresh fails while cached media is available.
…re-fix

Bugfix/storacha upload failure fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants