Change "DNF: Do not download filelists by default" seems to have broken dnf -C provides

Wiki page for the change is here. It says:

Note that after this change, users can still use DNF without filelists metadata when querying file provides located in /usr/bin, /usr/sbin or /etc directories.

However,

> dnf -C provides /usr/bin/intel_gpu_time
Error: Cache-only enabled but no cache for 'updates'

But then…

> echo optional_metadata_types=filelists | sudo tee -a /etc/dnf/dnf.conf && sudo dnf makecache
optional_metadata_types=filelists
Fedora 40 - x86_64                                                  2.4 MB/s |  75 MB     00:31    
Fedora 40 openh264 (From Cisco) - x86_64                            3.2 kB/s | 2.1 kB     00:00    
Fedora 40 - x86_64 - Updates                                         13 MB/s |  39 MB     00:02    
RPM Fusion for Fedora 40 - Free                                     466 kB/s | 603 kB     00:01    
RPM Fusion for Fedora 40 - Free - Updates                           382 kB/s | 317 kB     00:00    
RPM Fusion for Fedora 40 - Nonfree                                  500 kB/s | 261 kB     00:00    
RPM Fusion for Fedora 40 - Nonfree - Updates                        163 kB/s | 106 kB     00:00    
Metadata cache created.

And now it works:

> dnf -C provides /usr/bin/intel_gpu_time
Last metadata expiration check: 0:02:06 ago on Sat 31 Aug 2024 03:58:23 PM CDT.
igt-gpu-tools-1.27.1-0.4.20230215git45da871.fc40.i686 : Test suite and tools
                                                      : for DRM drivers
Repo        : fedora
Matched from:
Filename    : /usr/bin/intel_gpu_time

igt-gpu-tools-1.27.1-0.4.20230215git45da871.fc40.x86_64 : Test suite and tools
                                                        : for DRM drivers
Repo        : @System
Matched from:
Filename    : /usr/bin/intel_gpu_time

igt-gpu-tools-1.27.1-0.4.20230215git45da871.fc40.x86_64 : Test suite and tools
                                                        : for DRM drivers
Repo        : fedora
Matched from:
Filename    : /usr/bin/intel_gpu_time

I think the issue may just be in the provides subcommand implementation, because this works:

$ dnf -C repoquery --whatprovides /usr/bin/intel_gpu_time
Last metadata expiration check: 2:46:14 ago on Wed 04 Sep 2024 12:55:29 AM EDT.
igt-gpu-tools-0:1.27.1-0.4.20230215git45da871.fc40.i686
igt-gpu-tools-0:1.27.1-0.4.20230215git45da871.fc40.x86_64

I do not have igt-gpu-tools installed.

Interestingly, though, it does not work in dnf5, even after a successful explicit cache refresh. Results are now the same as dnf5 provides:

$ sudo dnf5 check-update --refresh >/dev/null
$ sudo dnf5 -C provides /usr/bin/intel_gpu_time
Updating and loading repositories:
Cache-only enabled but no cache for repository "updates"

$ sudo dnf5 -C repoquery --whatprovides /usr/bin/intel_gpu_time
Updating and loading repositories:
Cache-only enabled but no cache for repository "fedora"

Once file metadata has been downloaded and cached, then both command versions start working:

$ sudo dnf5 provides /usr/bin/intel_gpu_time
Updating and loading repositories:
[...lotta downloads...]
Repositories loaded.
igt-gpu-tools-1.27.1-0.4.20230215git45da871.fc40.i686 : Test suite and tools for DRM drivers
Repo         : fedora
Matched From : 
Filename     : /usr/bin/intel_gpu_time

igt-gpu-tools-1.27.1-0.4.20230215git45da871.fc40.x86_64 : Test suite and tools for DRM drivers
Repo         : fedora
Matched From : 
Filename     : /usr/bin/intel_gpu_time

$ sudo dnf5 -C provides /usr/bin/intel_gpu_time
Updating and loading repositories:
Repositories loaded.
igt-gpu-tools-1.27.1-0.4.20230215git45da871.fc40.i686 : Test suite and tools for DRM drivers
Repo         : fedora
Matched From : 
Filename     : /usr/bin/intel_gpu_time

igt-gpu-tools-1.27.1-0.4.20230215git45da871.fc40.x86_64 : Test suite and tools for DRM drivers
Repo         : fedora
Matched From : 
Filename     : /usr/bin/intel_gpu_time

$ sudo dnf5 -C repoquery --whatprovides /usr/bin/intel_gpu_time
Updating and loading repositories:
Repositories loaded.
igt-gpu-tools-0:1.27.1-0.4.20230215git45da871.fc40.i686
igt-gpu-tools-0:1.27.1-0.4.20230215git45da871.fc40.x86_64