Skip to content

ngclient: Make refresh() optional #1650

Description

@jku

A core design change in ngclient (compared to legacy) is that the updater only loads metadata in "dependency order": this means reloading e.g. root metadata after timestamp metadata is loaded is just not possible. This means that calling Updater.refresh() multiple times is not possible: if user wants to "load a new repository snapshot" they should create a new Updater*.

This leads to refresh() call becoming rather unnecessary: we can just run that automatically the first time get_targetinfo() is called. I don't want to remove refresh() from the API completely as it does do multiple http requests and the targets response could be large, so some clients might want to do refresh() explicitly. I do want to make calling refresh() optional.

This is the last part of #1580.

*) we could make multiple refreshes work: it would just mean almost the same thing as creating a new Updater. The only thing that would be optimized is not reading root.json from disk

Metadata

Metadata

Assignees

Labels

backlogIssues to address with priority for current development goals

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions