Skip to content

Resolution cache values should be immutable to prevent accidental corruption #1021

@LalatenduMohanty

Description

@LalatenduMohanty

BootstrapRequirementResolver._resolved_requirements (introduced in #975) uses mutable list values. Since get_cached_resolution returns the cached list by reference, any caller that appends, removes, or reorders items would silently corrupt the shared cache, affecting all subsequent lookups for that requirement.

Making the values immutable prevents this class of bug at the type level.

Metadata

Metadata

Assignees

Labels

easyeasy taskenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions