We need to change how filtering works as we have many issues with it now. If the lockfile is not up-to-date, when a filtered install happens, we should do a non-filtered full resolution lockfile-only install first. (This will be less terrible in pnpm v9 as in v9 pnpm doesn't download the package tarballs during resolution.)
Originally posted by @zkochan in #8020 (comment)