Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/vws/vws.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ def wait_for_target_processed(
while True:
report = self.get_target_summary_report(target_id=target_id)
if report.status != TargetStatuses.PROCESSING:
# Guard against the target still being seen as
# processing by other endpoints due to eventual
# consistency.
time.sleep(seconds_between_requests)
Copy link

Choose a reason for hiding this comment

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

Missing re-verification after sleep defeats confirmation purpose

Medium Severity

The PR description states this change will "sleep and verify status once more before returning," but the implementation only calls time.sleep and then unconditionally returns without re-querying get_target_summary_report. There is no actual confirmation check — if the initial non-PROCESSING status was a transient read due to eventual consistency, the method still returns as if the target is fully processed. The sleep alone doesn't guard against the scenario described in the comment if the summary report endpoint itself can return stale data.

Fix in Cursor Fix in Web

return

elapsed_time = time.monotonic() - start_time
Expand Down