-
Notifications
You must be signed in to change notification settings - Fork 8.2k
fix-downloads-dedup-clean #2989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…; disable local JS fetch
…eep tab indentation
Agent Task Evaluation Results: 3/4 (75%)View detailed results
Check the evaluate-tasks job for detailed task execution logs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 1 file
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
This commit updates the DownloadsWatchdog class to ensure that the downloads directory path is properly expanded and resolved to an absolute path. The changes include: - Expanding the downloads path using `expanduser()` and `resolve()` methods to handle user home directories correctly. - Updating the download behavior settings to use the expanded path. - Ensuring that the downloads directory is created with the resolved path. Additionally, the example feature for downloading files has been modified to use a temporary downloads path for testing purposes.
This commit modifies the `download_file.py` example to replace the `BrowserSession` and `BrowserProfile` with the new `Browser` class. The changes streamline the code and enhance clarity by directly utilizing the `Browser` for managing downloads. The download path remains set to a temporary directory for testing purposes.
This commit updates the DownloadsWatchdog class to specify exception types in the error handling logic, replacing broad exception catches with more precise ones (AssertionError, KeyError, AttributeError). Additionally, it adds a warning log when no downloads path is configured, ensuring better error visibility and handling during download operations.
# Skip if already handled by progress/JS fetch | ||
info = self._cdp_downloads_info.get(guid, {}) | ||
if info.get('handled'): | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Download Deduplication Fails with Empty GUIDs
The new download deduplication logic can incorrectly skip downloads. If a GUID is empty, multiple downloads might share a 'handled' status. In the polling loop, the deduplication check uses the initial event's GUID, which can skip legitimate concurrent downloads. Also, downloads detected via polling are no longer tracked in browser_session._downloaded_files
, leading to inconsistent tracking.
Auto-generated PR for branch: fix-downloads-dedup-clean
Summary by cubic
Fixes duplicate local download events by ensuring each download is dispatched once, and hardens download handling for both local and remote sessions.