You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initialize the bot with mwn.init, and use a BotPassword
add defaultParams: { assert: 'user' } (as described in mwn.readthedocs.io)
attempt to login with client.getSiteInfo()
The wiki sends a high maxlag value
Current behavior:
the bot attempts to login, receives maxlag, waits 5 seconds, assertUser fails, and the bot tries to login again.
This cycle will continue infinitely (ignoring maxRetries), until maxlag clears and the bot manages to login, at which point it will crash with message "already logged in".
Expected behavior:
it should respect maxRetries, and attempt to login only 3 times by default.
assertuserfailed should not reset the maxRetries counter
When maxlag clears it should not crash after successfully logging in.
See log below:
Encountered maxlag: 9.437752 seconds lagged. Waiting for 5 seconds before retrying
[2024-12-04 21:10:08] [W] Received assertuserfailed, attempting to log in and retry
[2024-12-04 21:10:08] [W] Encountered maxlag: 12.360417 seconds lagged. Waiting for 5 seconds before retrying
[2024-12-04 21:10:13] [W] Received assertuserfailed, attempting to log in and retry
[2024-12-04 21:10:13] [W] Encountered maxlag: 10.485554 seconds lagged. Waiting for 5 seconds before retrying
[2024-12-04 21:10:18] [W] Received assertuserfailed, attempting to log in and retry
[2024-12-04 21:10:18] [W] Encountered maxlag: 9.296703 seconds lagged. Waiting for 5 seconds before retrying
[2024-12-04 21:10:23] [W] Received assertuserfailed, attempting to log in and retry
[2024-12-04 21:10:25] [S] [mwn] Login successful: [REDACTED]
[REDACTED]/node_modules/mwn/build/error.js:43
return Promise.reject(new MwnError(errorConfig));
^
MwnError: Already logged in as [REDACTED], logout first to re-login
at Object.rejectWithError ([REDACTED]/node_modules/mwn/build/error.js:43:27)
at mwn.login ([REDACTED]/node_modules/mwn/build/bot.js:443:24)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Response.process ([REDACTED]/node_modules/mwn/build/core.js:185:17)
at async Response.process ([REDACTED]/node_modules/mwn/build/core.js:185:17)
at async mwn.login ([REDACTED]/node_modules/mwn/build/bot.js:388:36)
at async Response.process ([REDACTED]/node_modules/mwn/build/core.js:185:17)
at async Response.process ([REDACTED]/node_modules/mwn/build/core.js:185:17)
at async mwn.login ([REDACTED]/node_modules/mwn/build/bot.js:388:36) {
code: 'mwn_failedlogin',
info: 'Already logged in as [REDACTED], logout first to re-login',
response: {
login: {
result: 'Aborted',
reason: 'Cannot log in when using MediaWiki\Session\BotPasswordSessionProvider sessions.'
}
}
}
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
defaultParams: { assert: 'user' }
(as described in mwn.readthedocs.io)client.getSiteInfo()
Current behavior:
Expected behavior:
See log below:
Encountered maxlag: 9.437752 seconds lagged. Waiting for 5 seconds before retrying
[2024-12-04 21:10:08] [W] Received assertuserfailed, attempting to log in and retry
[2024-12-04 21:10:08] [W] Encountered maxlag: 12.360417 seconds lagged. Waiting for 5 seconds before retrying
[2024-12-04 21:10:13] [W] Received assertuserfailed, attempting to log in and retry
[2024-12-04 21:10:13] [W] Encountered maxlag: 10.485554 seconds lagged. Waiting for 5 seconds before retrying
[2024-12-04 21:10:18] [W] Received assertuserfailed, attempting to log in and retry
[2024-12-04 21:10:18] [W] Encountered maxlag: 9.296703 seconds lagged. Waiting for 5 seconds before retrying
[2024-12-04 21:10:23] [W] Received assertuserfailed, attempting to log in and retry
[2024-12-04 21:10:25] [S] [mwn] Login successful: [REDACTED]
[REDACTED]/node_modules/mwn/build/error.js:43
return Promise.reject(new MwnError(errorConfig));
^
MwnError: Already logged in as [REDACTED], logout first to re-login
at Object.rejectWithError ([REDACTED]/node_modules/mwn/build/error.js:43:27)
at mwn.login ([REDACTED]/node_modules/mwn/build/bot.js:443:24)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Response.process ([REDACTED]/node_modules/mwn/build/core.js:185:17)
at async Response.process ([REDACTED]/node_modules/mwn/build/core.js:185:17)
at async mwn.login ([REDACTED]/node_modules/mwn/build/bot.js:388:36)
at async Response.process ([REDACTED]/node_modules/mwn/build/core.js:185:17)
at async Response.process ([REDACTED]/node_modules/mwn/build/core.js:185:17)
at async mwn.login ([REDACTED]/node_modules/mwn/build/bot.js:388:36) {
code: 'mwn_failedlogin',
info: 'Already logged in as [REDACTED], logout first to re-login',
response: {
login: {
result: 'Aborted',
reason: 'Cannot log in when using MediaWiki\Session\BotPasswordSessionProvider sessions.'
}
}
}
The text was updated successfully, but these errors were encountered: