feat(account): unlink game accounts on the shard before an account is deleted (MODULE_API 1.20.0)
ACCOUNT_DELETION.md §4.4 (AD10, AD11). api.onUserDeleting queues every linked
account in the new shard_pending_unlinks table, then calls the sidecar's
DELETE /link/{account} (actor web:account-deletion) and drops the mirror on 200/404.
A shard that is away leaves the row pending, retried on WS reconnect and on a live
server.hello; a protected account (403) is refused and listed on Admin -> Shard as
still linked on the shard. A live mob.login without the deleted user's webId clears
the row. coreApi ^1.20.0; core-ref pinned to website#232's merge (7bd93b8).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -52,6 +52,7 @@ const engagementSeeds = require('./config/engagementSeeds')
|
||||
const teamProvider = require('./model/teamProvider/teamProvider.model')
|
||||
const guildCommand = require('./commands/guild.command')
|
||||
const boot = require('./boot')
|
||||
const accountDeletion = require('./utils/accountDeletion')
|
||||
/* eslint-enable global-require */
|
||||
|
||||
const log = core.logger()
|
||||
@@ -184,6 +185,13 @@ const engagementSeeds = require('./config/engagementSeeds')
|
||||
api.onBoot(boot.onBoot)
|
||||
api.onShutdown(boot.onShutdown)
|
||||
|
||||
// Account deletion (MODULE_API 1.20.0; ACCOUNT_DELETION.md §4.4, AD10, AD11).
|
||||
// Core asks before the users row goes: each linked game account is unlinked on
|
||||
// the shard through the staff unlink's path, so the shard stops reporting the
|
||||
// deleted user's id. It cannot stop the deletion; what the shard could not take
|
||||
// now waits in `shard_pending_unlinks` and is retried when the bridge is back.
|
||||
api.onUserDeleting(accountDeletion.onUserDeleting)
|
||||
|
||||
log.info('registered', {
|
||||
version: require('../module.json').version,
|
||||
routes: 'public:/shard,/atlas admin:/shard,/uo-link player:/shard',
|
||||
|
||||
Reference in New Issue
Block a user