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
{{ message }}
Repository navigation
WtPage.edit() returns normally for a page that was not saved #233
WtPage.edit() can return normally for a page that was not saved. A direct call to edit() has no check that the page exists afterwards. #182 added such a check to store_entity, but not to WtPage.edit().
Where
WtPage._edit() sends the editslots call and does not read its response:
So edit() can report success only on the basis that no exception was raised. That is not the same as a saved page. The same reasoning was the cause of #175.
Observed
On wiki-dev.open-semantic-lab.org, a script created a new page with three set_slot_content calls and then page.edit("..."):
The script printed created and exited with code 0.
The page does not exist: action=purge returns missing and the revision query returns no revisions.
The same content sent with a direct mw_site.api("editslots", ...) call raises APIError('mwjson-category-edit-right-denied', '... The right mwjson-editpatch is required.').
The script finished within seconds. Five failed attempts with sleep(5) take at least 20 seconds, so edit() did not run the retry loop to its end. OSW_LOG_LEVEL=OFF was set, so warnings were not visible.
The reason why edit() did not raise is not known. Possible causes: the editslots response contained an error that mwclient did not raise, or the call was not sent. Neither is verified.
Expected
edit() raises when the page was not saved.
The editslots response is checked for an error entry, or the page is read back after the edit and compared with the requested content.
Next step to find the cause: repeat the steps with OSW_LOG_LEVEL=DEBUG and log the raw editslots response, against a page type the account may not write.
Activity