Describe the bug
DesktopBot.find_all returns immediately when its first screenshot contains no match, even if waiting_time has not expired. The loop checks if not eles, but locate_all_opencv returns a generator, and an empty generator object is truthy. The retry path is skipped and the call returns an empty list rather than trying a later screenshot. The current main branch at 9d5deaa89520c6e4cec61248f2c0c71931160866 reproduces this using a stubbed screenshot sequence.
Expected behavior
find_all should keep checking screenshots until it finds matches or the configured waiting_time is exhausted.
Steps to Reproduce
- Call
DesktopBot.find_all with a positive waiting_time.
- Stub
get_screenshot to return two images without the target, followed by an image with the target.
- Observe that
main returns [] after the first screenshot instead of finding the later target.
The regression test on existing PR #69 exercises this sequence without a physical screen.
Possible Solution
Materialize the locate_all_opencv generator before checking whether it contains matches, so an empty result continues the wait loop.
My Platform
Observed on repository main at 9d5deaa89520c6e4cec61248f2c0c71931160866; reproduction uses a stubbed screenshot sequence and does not require a physical display. Exact first affected package release is not established.
Additional context
This ticket is being filed to track already-open PR #69, which predates it, and make the contribution issue reference explicit. Issue #50 covers duplicate detections in find_all, not the wait/retry behavior described here.
This contribution was prepared with AI assistance by breken-ai.
Describe the bug
DesktopBot.find_allreturns immediately when its first screenshot contains no match, even ifwaiting_timehas not expired. The loop checksif not eles, butlocate_all_opencvreturns a generator, and an empty generator object is truthy. The retry path is skipped and the call returns an empty list rather than trying a later screenshot. The currentmainbranch at9d5deaa89520c6e4cec61248f2c0c71931160866reproduces this using a stubbed screenshot sequence.Expected behavior
find_allshould keep checking screenshots until it finds matches or the configuredwaiting_timeis exhausted.Steps to Reproduce
DesktopBot.find_allwith a positivewaiting_time.get_screenshotto return two images without the target, followed by an image with the target.mainreturns[]after the first screenshot instead of finding the later target.The regression test on existing PR #69 exercises this sequence without a physical screen.
Possible Solution
Materialize the
locate_all_opencvgenerator before checking whether it contains matches, so an empty result continues the wait loop.My Platform
Observed on repository
mainat9d5deaa89520c6e4cec61248f2c0c71931160866; reproduction uses a stubbed screenshot sequence and does not require a physical display. Exact first affected package release is not established.Additional context
This ticket is being filed to track already-open PR #69, which predates it, and make the contribution issue reference explicit. Issue #50 covers duplicate detections in
find_all, not the wait/retry behavior described here.This contribution was prepared with AI assistance by breken-ai.