Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

pyrate-limiter 4.0.1 removed BucketFullException from its public API, breaking module imports.

Changes

Dependency constraint

  • Allow pyrate-limiter v4.x (>=3.7.0,<5)

Rate limiting pattern migration

  • Replace exception-based pattern with return value checks using blocking=False
  • Remove BucketFullException import and try/except blocks
  • Remove deprecated max_delay parameter from Limiter initialization

Example migration

# v3.x
try:
    await self._login_limiter.try_acquire_async("login")
except BucketFullException as ex:
    raise RoborockRateLimit("Rate limit reached") from ex

# v4.x
success = await self._login_limiter.try_acquire_async("login", blocking=False)
if not success:
    raise RoborockRateLimit("Rate limit reached")

Test fixtures

  • Mock try_acquire_async to return True (in addition to existing try_acquire)
Original prompt

This section details on the original issue you should resolve

<issue_title>Compatibility issue with latest pyrate-limiter release 4.0.1</issue_title>
<issue_description>### Description

With the latest release of pyrate-limiter, 4.0.1, python-roborock raises an ImportError during module import due to a change in pyrate-limiter public exports.

The exception BucketFullException is no longer exposed at the top-level pyrate_limiter package,
https://github.com/vutran1710/PyrateLimiter/blob/master/docs/migrating.md
Image

which breaks the import in roborock/web_api.py.


Error

ImportError: cannot import name 'BucketFullException' from 'pyrate_limiter'
</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 23, 2026 00:11
Co-authored-by: Lash-L <20257911+Lash-L@users.noreply.github.com>
Co-authored-by: Lash-L <20257911+Lash-L@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compatibility issue with pyrate-limiter 4.0.1 Fix compatibility with pyrate-limiter 4.0.1 Jan 23, 2026
Copilot AI requested a review from Lash-L January 23, 2026 00:16
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

❌ Patch coverage is 26.92308% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
roborock/web_api.py 26.92% 14 Missing and 5 partials ⚠️
Files with missing lines Coverage Δ
tests/fixtures/web_api_fixtures.py 100.00% <ø> (ø)
roborock/web_api.py 52.31% <26.92%> (-0.43%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compatibility issue with latest pyrate-limiter release 4.0.1

2 participants