What's Changed
Bug fix release — dashboard no longer renders empty when a user accidentally has more than one configs row.
Fixed
-
Dashboard showed zeros / "no repositories" while data was intact in the database (#271). Several
SELECT … FROM configs WHERE userId = ? LIMIT 1queries had noORDER BY, so when a user's database accidentally contained more than oneconfigsrow for the same user (from an env-loader insert path or a partial default-config create), SQLite returned a non-deterministic row.In the reported case
/api/confighanded back an empty stub while/api/dashboard's repo and org counts came from the populated active row. The dashboard'suseConfigStatushook then saw missingusername/token, treated config as incomplete, and never fetched dashboard data — the UI rendered with all zeros even though hundreds of repos were sitting in the database, mirroring fine in the background.Every "fetch the user's config" query now applies
ORDER BY isActive DESC, updatedAt DESCbeforeLIMIT 1, so the active and most-recently-updated row consistently wins. The env-config-loader's "first user" pick is now ordered bycreatedAt ASCfor the same deterministic-across-restarts reason.Sites that already filter on
isActive = trueexplicitly (cleanup service, scheduler, repositories/organizations/orgs-sync/cleanup-trigger endpoints) are unchanged.
Compatibility
No schema changes, no migrations. The fix is purely a query-level change: for the ~99% of installs that have a single config row, behavior is identical. For installs with duplicate config rows, the active populated row is now selected instead of a random one.
Verification
All 231 unit tests pass. bun run build succeeds.
Full Changelog: v3.15.3...v3.15.4