`public.packages` view should take `app.package_upgrades` into account as well for its latest_version column.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Locate the definition of the public.packages view and inspect how app.package_versions and app.package_upgrades provide version values. Reproduce with my_ext--1.0.0.sql and my_ext--1.0.0--2.0.0.sql, then verify that latest_version reports 2.0.0 rather than 1.0.0.
Written by the indexing model from the issue text.
Description
Currently the public.packages view is defined like this:
create or replace view public.packages as
select
pa.id,
pa.package_name,
pa.handle,
pa.partial_name,
newest_ver.version as latest_version,
newest_ver.description_md,
pa.control_description,
pa.control_requires,
pa.created_at,
pa.default_version
from
app.packages pa,
lateral (
select *
from app.package_versions pv
where pv.package_id = pa.id
order by pv.version_struct desc
limit 1
) newest_ver;
Notice how in the lateral clause only app.package_versions are read but there's no app.package_upgrades. This results in the latest version being returned as less if there is one base version with an upgrade.
To reproduce publish an extension with my_ext--1.0.0.sql and my_ext--1.0.0--2.0.0.sql files and notice how the latest version reported is 1.0.0.
To fix, the view should take the maximum version from among the app.package_versions's version column and app.package_upgrade's to_version column.
- Dominant language
- TypeScript
- Stars
- 443
- Forks
- 31
- Avg merge
- 1h 12m
- Merged PRs (30d)
- 10
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/dbdev
-
documentation
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
safetrustcr/dApp-SafeTrust#426 ·
-
area:workflow bug ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
fil-donadoni/tolaria#4409 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Fission-AI/OpenSpec#1960 ·
-
Add dependabot Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
corsairdev/corsair#1764 ·