Enhance Downloads Functionality #56
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces significant improvements to the
DownloadManagerto enhance reliability, user experience, and persistence of download history. The most notable changes include implementing a robust internal ID mapping system to prevent collisions, adding persistent download history with disk-backed storage, and improving UI logic so completed and failed downloads remain visible until the user clears them. Additionally, new utility methods have been added for encoding/decoding fields and managing history snapshots.Download ID Management Improvements
external_to_internal_id_and related logic) to prevent collisions and ensure downloads are tracked consistently, even if external IDs are reused by Ultralight. This affects download request, begin, finish, fail, and cleanup logic. [1] [2] [3] [4] [5] [6]Persistent Download History
LoadHistoryFromDisk), updated and trimmed on changes, and saved back to disk. This ensures download records are retained across sessions and only a maximum number of entries are kept. [1] [2] [3] [4]UI and User Experience Enhancements
Utility Methods for History Encoding/Decoding
General Codebase Enhancements
<vector>,<cstdio>) for new functionality.Let me know if you want to dive deeper into any specific change!