Skip to content

fix: Melos doesn't handle being rate limited.Β #970

@bsutton

Description

@bsutton

Is there an existing issue for this?

  • I have searched the existing issues.

Version

7.3.0

Description

ERROR: ERROR: ____ [orders]: 429 Too Many Requests trying to find package xxxx at https://onepub.dev/api/yyyy/. ____ Reading pub registry for package information... 
Unhandled exception: 
Exception: Error reading [pub.dev](http://pub.dev/) registry for package "mmmmmm" (HTTP Status 429), response: {} 
#0 PubHostedClient.fetchPackage (package:melos/src/common/pub_hosted.dart:62:7)  
#1 _PublishMixin._getLatestPublishedVersionForPackages. (package:melos/src/commands/publish.dart:131:26)  
#2 Pool.forEach.run (package:pool/pool.dart:183:19)  
#3 Pool.withResource (package:pool/pool.dart:127:14)  
#4 Future.wait. (dart:async/future.dart:520:21)  
#5 Pool.forEach.onListen. (package:pool/pool.dart:203:23)  
#6 _StreamController.close (dart:async/stream_controller.dart:628:3)  
#7 _nullDataHandler (dart:async/stream_impl.dart:518:1)

Steps to reproduce

create a collection of apps/packages that together require more requests that allows by the package repository.

Expected behavior

When melos receives a 429, it should retry the request using a backoff strategy (as the dart pub command does).

I would expect that all pub api calls should use the same retry/backoff strategy.

Screenshots

No response

Additional context and comments

The problem occured when using the onepub private repo which enforces a rate limit of 50 requests per 5 seconds per token (user).
The dart pub command works correctly when rate limited, melos does not.

Other

  • I'm interested in working on a PR for this.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requestfeature requesttype: acceptedMarks issues/pull requests that are accepted & scheduled to be worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions