mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #4206] [MERGED] Fix silently ignored errors in password migration seeder #5626
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5626
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/4206
Author: @hobostay
Created: 5/10/2026
Status: ✅ Merged
Merged: 5/10/2026
Merged by: @MHSanaei
Base:
main← Head:fix/db-seeder-ignored-errors📝 Commits (1)
72d1310Fix silently ignored errors in password migration seeder📊 Changes
1 file changed (+12 additions, -3 deletions)
View changed files
📝
database/db.go(+12 -3)📄 Description
Summary
database/db.gorunSeeders()functionIssues Fixed
Pluck("seeder_name", &seedersHistory)— If this fails,seedersHistoryis empty, causing the seeder to re-run and potentially double-hash already bcrypt'd passwords, corrupting them and locking users out.Find(&users)— If this fails, theusersslice is empty, so no passwords get migrated, but the seeder still marks itself as complete. Users remain with old-format passwords indefinitely.Update("password", hashedPassword)— If this fails for any user, their password silently remains in the old format while other users are migrated, creating an inconsistent state.All three now properly check errors and return early with descriptive log messages.
Test plan
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.