The hosted-mode account panel exists in two parallel implementations:
- Class methods on
PatreonLoginUI in scripts/patreon-login-ui.mjs — _fetchQuota, _fetchRagStatus, _fetchSharedTierStatus, _refreshTier. Operate on this.quota / this.ragStatus / this.sharedTier / this._quotaFetchAttempted.
- Module-level functions in
scripts/config.mjs:1072-1188 — _handleRefreshTier, _fetchAccountData, _fetchRagStatus, _fetchSharedTierStatus. Operate on _accountPanelState (a shared mutable module-scope object).
The two implementations have:
- Identical fetch logic, copy-pasted
- The same bugs duplicated (silent-fetch swallowing, latch-never-resets)
- Diverged conventions: one uses
game.loremaster?.socketClient (post-8e3ea7f), the other still uses the stale game.modules.get('loremaster')?.api?.getSocketClient?.()
Why this is structural: every fix to the account panel has to land in both places, and the divergence in conventions means whoever fixes one almost certainly forgets the other. Several of the P1/P2 bugs filed alongside this issue all fan out from this duplication.
Suggested direction: extract a single account-panel.mjs (or similar) that owns the fetch state machine and exposes fetchAll() / refreshTier() / observable state. Both the inline settings panel and the standalone login dialog consume it. Refactor — file separately and tackle after the P1 bugs land in both copies.
The hosted-mode account panel exists in two parallel implementations:
PatreonLoginUIinscripts/patreon-login-ui.mjs—_fetchQuota,_fetchRagStatus,_fetchSharedTierStatus,_refreshTier. Operate onthis.quota/this.ragStatus/this.sharedTier/this._quotaFetchAttempted.scripts/config.mjs:1072-1188—_handleRefreshTier,_fetchAccountData,_fetchRagStatus,_fetchSharedTierStatus. Operate on_accountPanelState(a shared mutable module-scope object).The two implementations have:
game.loremaster?.socketClient(post-8e3ea7f), the other still uses the stalegame.modules.get('loremaster')?.api?.getSocketClient?.()Why this is structural: every fix to the account panel has to land in both places, and the divergence in conventions means whoever fixes one almost certainly forgets the other. Several of the P1/P2 bugs filed alongside this issue all fan out from this duplication.
Suggested direction: extract a single
account-panel.mjs(or similar) that owns the fetch state machine and exposesfetchAll()/refreshTier()/ observable state. Both the inline settings panel and the standalone login dialog consume it. Refactor — file separately and tackle after the P1 bugs land in both copies.