github RayLabsHQ/gitea-mirror v3.15.4

5 hours ago

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 1 queries had no ORDER BY, so when a user's database accidentally contained more than one configs row 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/config handed back an empty stub while /api/dashboard's repo and org counts came from the populated active row. The dashboard's useConfigStatus hook then saw missing username/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 DESC before LIMIT 1, so the active and most-recently-updated row consistently wins. The env-config-loader's "first user" pick is now ordered by createdAt ASC for the same deterministic-across-restarts reason.

    Sites that already filter on isActive = true explicitly (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

Don't miss a new gitea-mirror release

NewReleases is sending notifications on new releases.