chore: bump gorm to 1.30.0 + fix dotted map-keyed Where regression#75
Merged
Conversation
Bumps:
- gorm.io/driver/mysql v1.5.7 → v1.6.0
- gorm.io/gorm v1.25.12 → v1.30.0 (transitive via the driver bump)
Code fix needed for the bump:
FindProfileByKeycloakID and FindProfileByDiscordID built their WHERE
clauses with a map[string]interface{} keyed on
"xf_user_connected_account.provider" / ".provider_key". gorm 1.25
forwarded such dotted keys verbatim. gorm 1.26+ (so 1.30 here)
treats the entire map key as a column name and prefixes it with
the current model's table, producing nonsense like
`xf_nf_rosters_user`.`xf_user_connected_account`.`provider`
in the rendered SQL — a three-part qualifier MariaDB rejects with
"Unknown column ... in 'where clause'".
Effect on develop: discord/keycloak ID lookups returned 404
("no user found") for every input. Insomnia suite went 61/61 → 49/61.
Fix: replace the dotted-key map with raw placeholder SQL on both
functions so the joined-table column names stay unqualified through
gorm's escape pass.
Smoked locally against a fresh XF DB mirror — both lookups return
200 with the expected profile, and the canonical-jq diff of the
other 11 baseline endpoints (ranks / position-groups / awol /
profile by id+username / full + lite rosters / s1 uniforms /
tickets categories+list+single) shows byte-for-byte identical
JSON content vs the pre-bump develop responses.
Supersedes #60.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bumps gorm + fixes a real regression the bump exposes.
Deps:
gorm.io/driver/mysqlv1.5.7 → v1.6.0gorm.io/gormv1.25.12 → v1.30.0 (transitive via the driver bump — 5 minor versions)Code fix:
FindProfileByKeycloakIDandFindProfileByDiscordIDindatastores/mysql.gobuilt theirWHEREclauses with amap[string]interface{}keyed onxf_user_connected_account.provider/.provider_key. gorm 1.25 forwarded those dotted keys verbatim; gorm 1.26+ treats the whole map key as a column name and prefixes it with the current model's table, producingxf_nf_rosters_user.xf_user_connected_account.provider— a three-part qualifier MariaDB rejects with1054 Unknown column ... in 'where clause'.Without the fix, every Discord-ID and Keycloak-ID profile lookup returns 404 ("no user found"). Discovered when the user's Insomnia suite went 61/61 → 49/61 against the gorm-only build.
Fix swaps the dotted-key map for raw placeholder SQL so the joined-table column names stay unqualified through gorm's escape pass.
Test plan
go build ./...cleango vet ./...cleanSupersedes #60 — that PR was dep-only and needs this code fix to pass.
🤖 Generated with Claude Code