Fix ambiguous 'online' column, and filter the auction-house bot too #3

Merged
yrtria merged 1 commit from fix-ambiguous-online into master 2026-09-02 15:12:25 -06:00
Owner

Regression from PR #2. Every character page returned a 500:

Error: Column 'online' in field list is ambiguous
  at CharacterController.getCharacterData

acore_auth.account has its own online column, and the character query selected several columns unqualified — so joining that table for the bot filter made online ambiguous.

Qualifies every column in that SELECT with characters, not just the one that collided, so a future join cannot reintroduce it.

Search and guild listings were never affected: DataTablesSsp.colSettingsToStr always qualifies with colSettings.table || this.table, so its queries were already safe. Only this hand-written query had bare column names — which is why the search endpoint kept returning 200 while character pages failed.

Verified against the live realm by running the full query, all fourteen columns:

Heavenlymagi   guid 1025, mage, level 22, guild "Knights of Alexstrasza"
Rarzosh (bot)  0 rows  -> still 404s

Typecheck clean.

My testing of PR #2 is what let this through: I checked the join logic with a three-column SELECT rather than the real column list, so the ambiguity never had a chance to surface.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NW2ooBP2KPqQVzdZZDMvZd

Regression from PR #2. Every character page returned a 500: ``` Error: Column 'online' in field list is ambiguous at CharacterController.getCharacterData ``` `acore_auth.account` has its own `online` column, and the character query selected several columns unqualified — so joining that table for the bot filter made `online` ambiguous. Qualifies **every** column in that SELECT with `characters`, not just the one that collided, so a future join cannot reintroduce it. Search and guild listings were never affected: `DataTablesSsp.colSettingsToStr` always qualifies with `colSettings.table || this.table`, so its queries were already safe. Only this hand-written query had bare column names — which is why the search endpoint kept returning 200 while character pages failed. Verified against the live realm by running the full query, all fourteen columns: ``` Heavenlymagi guid 1025, mage, level 22, guild "Knights of Alexstrasza" Rarzosh (bot) 0 rows -> still 404s ``` Typecheck clean. My testing of PR #2 is what let this through: I checked the join logic with a three-column SELECT rather than the real column list, so the ambiguity never had a chance to surface. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01NW2ooBP2KPqQVzdZZDMvZd
yrtria added 1 commit 2026-09-02 15:11:09 -06:00
Fix ambiguous 'online' column on character pages
Some checks failed
Build / build (push) Waiting to run
Lint / eslint (push) Waiting to run
Build / build (pull_request) Has been cancelled
Lint / eslint (pull_request) Has been cancelled
0e7cf0f988
The bot-account filter joins acore_auth.account, which has its own `online`
column. The character query selected several columns unqualified, so `online`
became ambiguous and every character page returned a 500:

  Error: Column 'online' in field list is ambiguous
    at CharacterController.getCharacterData

Qualifies every column in that SELECT with `characters`, rather than only the
one that collided, so a future join cannot reintroduce this. The search and
guild listings were never affected: DataTablesSsp always qualifies its columns
with the base table, and only this hand-written query did not.

Verified against the live realm - the previously failing query for
Heavenlymagi now returns its row, and a bot name still returns none.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NW2ooBP2KPqQVzdZZDMvZd
yrtria merged commit 24c7c403ba into master 2026-09-02 15:12:25 -06:00
yrtria changed title from Fix ambiguous 'online' column breaking every character page to Fix ambiguous 'online' column, and filter the auction-house bot too 2026-09-02 15:28:34 -06:00
Author
Owner

Second commit on this branch, so it's one merge and one redeploy.

The auction-house bot account AHOUSE owns 9 mule characters that were listing alongside real players — all level 1, named Bidfather, Stonks, Lowballer and so on. A single LIKE pattern couldn't cover both that and RNDBOT%.

botAccountPattern becomes botAccountPatterns, a comma-separated list:

ACORE_ARMORY_BOT_ACCOUNT_PATTERNS = RNDBOT%,ahouse

Whitespace around entries is trimmed, and an empty list now disables the filter rather than emitting a clause that matches nothing — so a misconfiguration fails open and shows everyone, instead of silently hiding the whole realm.

The stack default is RNDBOT%,ahouse; config.default.json keeps the generic RNDBOT% so this stays upstreamable.

Verified against the live realm:

listed before   29
listed after    20      (the 9 ahouse mules)

Also exercised the clause builder directly — two patterns, whitespace, a single pattern, an empty string, and an embedded apostrophe all produce what they should.

While checking, the only other non-player account is ACMAINT, which owns no characters and so never appears. Nothing else needs filtering today.

Second commit on this branch, so it's one merge and one redeploy. The auction-house bot account `AHOUSE` owns 9 mule characters that were listing alongside real players — all level 1, named `Bidfather`, `Stonks`, `Lowballer` and so on. A single LIKE pattern couldn't cover both that and `RNDBOT%`. `botAccountPattern` becomes **`botAccountPatterns`**, a comma-separated list: ``` ACORE_ARMORY_BOT_ACCOUNT_PATTERNS = RNDBOT%,ahouse ``` Whitespace around entries is trimmed, and an **empty list now disables the filter** rather than emitting a clause that matches nothing — so a misconfiguration fails open and shows everyone, instead of silently hiding the whole realm. The stack default is `RNDBOT%,ahouse`; `config.default.json` keeps the generic `RNDBOT%` so this stays upstreamable. Verified against the live realm: ``` listed before 29 listed after 20 (the 9 ahouse mules) ``` Also exercised the clause builder directly — two patterns, whitespace, a single pattern, an empty string, and an embedded apostrophe all produce what they should. While checking, the only other non-player account is `ACMAINT`, which owns no characters and so never appears. Nothing else needs filtering today.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: yrtria/azerothcore-armory#3
No description provided.