tosher / Mediawiker

A plugin for Sublime Text editor that adds possibility to use it as Wiki Editor on MediaWiki-based sites like Wikipedia and many other.
Other
137 stars 27 forks source link

Retry login on failed save (fix for Fandom wiki farm) #188

Closed RheingoldRiver closed 9 months ago

RheingoldRiver commented 3 years ago

Since UCP last year, Fandom's connection generally times out after 4-5 hours, resulting in a failed connection. The easiest way to deal with this is to begin using a totally new site object (relogging with existing site object doesn't work either). Prior to this fix, pretty much every day I'd have to redo a save operation after it failed once; this way, it just auto-retries, and will continue working afterwards too.

Example (though I changed the display text a bit since then):

image

tosher commented 3 years ago

Thanks, I will check it!

tosher commented 2 years ago

Please, get the latest mw_utils.py from master branch (unreleased) and try to use it. If it will be the same result, please put debug messages here ("debug": true).

RheingoldRiver commented 2 years ago

Just to make sure I understand - you want me to merge master into this branch and make sure it still works? Or did you re-implement this PR in the current master branch?

tosher commented 2 years ago

I made some changes in original master branch, no needs to merge. Before make final changes I want to understand the problem more deeply :)

RheingoldRiver commented 2 years ago

Ok. I can't reproduce this error more than once per couple of days (since you have to go a certain amount of time without connecting in order for it to happen) so it might take some time to get back to you.

tosher commented 2 years ago

Ok, thank you!

RheingoldRiver commented 2 years ago

Ok actually I was able to repro pretty quickly:

image

I talked to one of the members of our backend development team, and he says that $wgObjectCacheSessionExpiry is set to 3600 so this may be what's causing the behavior on Fandom specifically, and forcing mwclient to establish a totally new session is what "fixes" the issue.

RheingoldRiver commented 2 years ago

Do you need any other info about this?

tosher commented 2 years ago

No, thank you! Sorry, I'm just a bit busy :)

RheingoldRiver commented 2 years ago

Hi, Even if this is not the best fix for the problem, it is a fix, could you maybe merge it for now & make a ticket to improve the solution in a future patch? This way we can deploy a workaround for everyone using the extension on Fandom in the meantime without needing to install git & work from my branch. Thanks!

tosher commented 2 years ago

Ok actually I was able to repro pretty quickly:

image

I talked to one of the members of our backend development team, and he says that $wgObjectCacheSessionExpiry is set to 3600 so this may be what's causing the behavior on Fandom specifically, and forcing mwclient to establish a totally new session is what "fixes" the issue.

You are logged-in without keep me logged in or with, in browser?

RheingoldRiver commented 2 years ago

Actually my fandom contract was just terminated so this is no longer relevant to me. Maybe @mszabo-wikia may be interested in pursuing this further, otherwise it can be closed.