feat: optimize cleanup logic and fix static resource bloat & fd leaks#598
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughCleanup logic across Android, HarmonyOS, and iOS platforms is updated: downloaded/temporary archive files are now deleted after patch operations complete, retention window for old entry cleanup is reduced from 7 to 3 days, and HarmonyOS resource-copy logic is refactored for reliable file descriptor closing. ChangesTemp file cleanup and retention window changes
Estimated code review effort: 2 (Simple) | ~12 minutes PoemA rabbit hops through code so tidy, ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
harmony/pushy/src/main/ets/DownloadTask.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: .eslintrc.js » harmony/pushy/src/main/ets/UpdateContext.tsOops! Something went wrong! :( ESLint: 8.57.1 Error: .eslintrc.js » Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR optimizes the hot update cleanup logic and fixes critical resource copying bugs on HarmonyOS:
Changes
mediaBuffer) instead of the underlyingArrayBuffer(mediaBuffer.buffer) when writing media resources. This prevents writing excessive raw buffer bytes to the sandbox files.try...finallyblock to ensureresourceManager.closeRawFdis always called to release file descriptors..ppk/.patchfiles immediately after successful decompression/patching rather than waiting for the old package clean-up job.All core unit tests and lints pass.
Summary by CodeRabbit