I misunderstood the API. A null value (in modern API) or a valid: false (in legacy API) occur when store path doesn't exist. Whether the store path itself is a valid store path doesn't matter, obviously if it is not a valid path, it won't be present in the store, but if it's valid and not installed, it will return null value or valid: false. The users of this function do not want to ignore these paths.
Edit: This bug is a bit less bad than initially thought. Because we install non-cached packages in flake, so anything missing would be installed then.
How was it tested?
Unit test.
This is tricky to test. I added a test script that can hopefully catch this.
Edit: This test doesn't actually catch this because the package ends up getting installed later on (in the flake). I still think this test is good to have.
Summary
Fix regression introduced in https://github.com/jetify-com/devbox/pull/2076
I misunderstood the API. A null value (in modern API) or a valid: false (in legacy API) occur when store path doesn't exist. Whether the store path itself is a valid store path doesn't matter, obviously if it is not a valid path, it won't be present in the store, but if it's valid and not installed, it will return null value or valid: false. The users of this function do not want to ignore these paths.
Edit: This bug is a bit less bad than initially thought. Because we install non-cached packages in flake, so anything missing would be installed then.
How was it tested?
Unit test.
This is tricky to test. I added a test script that can hopefully catch this.
Edit: This test doesn't actually catch this because the package ends up getting installed later on (in the flake). I still think this test is good to have.