Skip to content

dependency_services report can select prerelease version even when the package is constrained to stable version #4660

@chika3742

Description

@chika3742

Environment

Dart SDK version: 3.9.2 (stable) (Wed Aug 27 03:49:40 2025 -0700) on "macos_arm64"
macOS 26.0 25A5349a

Problem

I noticed that Dependabot had created an update pull request for a pre-release version in my repository.

Image

After investigating, I found that the problem was not with Dependabot, but rather that Pub's dependency_services was not returning the correct results. Specifically, the report command of dependency_services was returning results that allowed updates to pre-release versions, even though the package constrained to stable versions.

Furthermore, this issue does not occur in simple projects with only a single dependency, but seems to happen only in projects with two or more complex dependencies as shown below.

name: dependabot_test
description: "A new Flutter project."

environment:
  sdk: '>=3.2.6 <4.0.0'

dependencies:
  flutter:
    sdk: flutter

  riverpod_lint: 2.6.5
  custom_lint: 0.7.6

Expected behavior

dependency_services report targeting riverpod_lint does not return any updates.

Actual behavior

dependency_services report targeting riverpod_lint returns updates to riverpod_lint 3.0.0-dev.17 and custom_lint 0.8.0 (multiBreaking).

--verbose output

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions