Skip to content

[Bug]: only the newest migration ever runs, and nothing records what was applied #1885

Description

@RAprogramm

Summary

The installer runs exactly one migration — the lexicographically highest filename — and keeps no record of what has already been applied. Anyone who skips a release never gets the migrations in between, and the moment a newer migration is added the current one stops running for everybody, including users who never got it.

Where

Scripts/install.sh:456-465

	if [ -d "${migrationDir}" ] && find "${migrationDir}" -type f | grep -q .; then
		migrationFile=$(find "${migrationDir}" -maxdepth 1 -type f -printf '%f\n' | sort -r | head -n 1)

		if [[ -n "${migrationFile}" && -f "${migrationDir}/${migrationFile}" ]]; then
			echo "Found migration file: ${migrationFile}"
			sh "${migrationDir}/${migrationFile}" || { true && print_log -warn "Migration" "Failed to execute ${migrationFile}"; }

Three problems in those lines:

  1. sort -r | head -n 1 picks a single file. Scripts/migrations/ currently holds v25.8.2.sh, v25.9.1.sh, v26.4.3.sh, v26.7.4.sh; only the last one ever executes.
  2. sort -r is lexicographic, not version-aware. v26.10.1 would sort below v26.4.3, so the newest migration would be the one skipped.
  3. There is no record of applied migrations, so a run cannot tell what is still outstanding. Add v26.8.x.sh tomorrow and v26.7.4.sh — the one that moves superseded shell helpers aside — never runs again for a user who has not upgraded yet.

Impact

v26.7.4.sh is what stops files deleted by the Lua release from shadowing the implementations that replaced them. A user upgrading from a pre-Lua release after the next migration lands will silently skip it and keep the stale helpers.

Expected

Every migration not yet applied runs, in version order, and each success is recorded so it does not run again. The existing migrations are all safe to re-run, so an installed base with no record simply replays them once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions