Skip to content

docs: backfill changelog from 3.0.54 to 3.0.66#67

Open
huhuanming wants to merge 4 commits into
mainfrom
fix/android-apk-download-dir-erofs
Open

docs: backfill changelog from 3.0.54 to 3.0.66#67
huhuanming wants to merge 4 commits into
mainfrom
fix/android-apk-download-dir-erofs

Conversation

@huhuanming

@huhuanming huhuanming commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Backfill CHANGELOG.md with release notes from 3.0.54 through 3.0.66.

Added entries

  • 3.0.54: segment-slider uncontrolled refactor, concurrent-download audit fixes, zip-archive error preservation
  • 3.0.55: device-utils iOS cold-start local-notification deep-link
  • 3.0.56: chart-webview warm-driver, Android pause-when-idle, attach retries
  • 3.0.57: chart-webview configurable "androidAssetHost"
  • 3.0.58: atomic iOS cold-start notification take, hardened Android pooled WebView reuse
  • 3.0.59: app-update / bundle-update cache-pruning APIs
  • 3.0.60: refresh iOS Podfile.lock
  • 3.0.61: split-bundle-loader segment eval ordering fix for "Requiring unknown module"
  • 3.0.63: background-thread coalesced runtime work
  • 3.0.64: hardened background-thread coalesced drain against threading bugs
  • 3.0.65: iOS split-bundle-loader suspend-aware active-time watchdog
  • 3.0.66: unified "ConcurrentRangeDownloader", APK downloads moved to "filesDir", hardened resume logic

Note: version 3.0.62 was not tagged/bumped in the repository, so it is skipped.

Replace module-local ConcurrentRangeDownloader with a single shared implementation and adapt consumers. Added a dependency on :onekeyfe_react-native-range-downloader in app-update's build.gradle and removed the duplicate ConcurrentRangeDownloader source from app-update. ReactNativeAppUpdate now imports the shared downloader and detects concurrent segment files when resuming; ReactNativeBundleUpdate cleans up legacy segment files and accounts for ".segN" in stem parsing. The range-downloader implementation was rewritten to stream into per-segment files (<partial>.segN), avoid full-file pre-allocation (fixes EROFS/ENOSPC on near-full devices), resume/concat segments into the final .partial, and adjust ETag/If-Range, cancellation and error handling accordingly.
Several fixes to make multi-segment downloads more robust and race-safe:

- Use OkHttp .use() to ensure responses are closed and avoid resource leaks.
- Treat segment files (<dest>.partial.segN) as first-class artifacts: sweep/delete sibling .segN on various error/restart paths in app-update and bundle-update so stale segment bytes can't be mistaken for valid resume data.
- Make progress reporting thread-safe by using AtomicInteger + CAS to emit monotonic progress only when it increases.
- Add defensive Content-Range handling: validate 206 Content-Range start matches expected resume offset (drop partial and restart if not), and in ConcurrentRangeDownloader verify per-segment Content-Range bounds and reject overlong segments.
- Change resume semantics: object identity is no longer pinned by ETag/If-Range. Resume is unconditional; the caller's whole-file SHA256/GPG verify remains the final correctness backstop. Removed ETag plumbing and If-Range logic.
- Correct progress accounting to include committed bytes already concatenated into .partial and avoid re-fetching segments whose extent is already covered by .partial.
- Improve segment selection: pending segments exclude segments already committed into .partial; keep incomplete segment files for later resume instead of wiping them.
- Add parseContentRangeBounds helper and related checks to ensure fetched slices exactly match the requested ranges.
- Add DEFAULT_SEGMENT_COUNT and sweep segmented artifacts in ReactNativeRangeDownloader discard/cancel paths.

These changes reduce corruption risk from misaligned 206s, stale sibling segments, and concurrent progress races, while keeping resume behavior predictable and recoverable via the final file verification.
Improve robustness of range/partial handling across native modules:

- AppUpdate & BundleUpdate: ensure leftover concurrent segment files (<partial>.segN) are removed when promoting/discarding partials, and treat 206 Content-Range start mismatches as retryable errors (close response, delete partial+segments, and throw) to avoid writing mis-aligned bytes. BundleUpdate adds a CONCURRENT_SEGMENT_COUNT constant and defers promotion if concurrent segments exist.
- RangeDownloader: replace hardcoded default segment sweep with sweepPartialArtifacts (glob by prefix) to clear any custom segment counts, and make progress reporting thread-safe using an AtomicInteger + CAS to dedupe/monotonize progress events.
- AppUpdate: read ASC files with response.use to always close connections, enforce a max ASC size, and avoid leaking response bodies.

These changes prevent mixing segmented and single-stream artifacts, avoid corrupted downloads from CDN/proxy 206 bugs, and fix leaked connections and duplicate progress events.
@huhuanming huhuanming force-pushed the fix/android-apk-download-dir-erofs branch from 1aa2e0a to e112de4 Compare June 12, 2026 15:45

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

Open in Devin Review

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.

1 participant