Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/217749

Change subject: Instrument edit failures
......................................................................

Instrument edit failures

Users on enwiki's VPT are reporting a spike in the frequency of rejected edits
due to loss of session data. It is difficult to corroborate these reports when
we don't have any instrumentation for them in the code, and thus no visibility
into how frequently they are occurring in the wild.

Change-Id: I0c99f292002209cf2bf4376f97b8c70a6b1ec021
---
M includes/EditPage.php
1 file changed, 8 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/49/217749/1

diff --git a/includes/EditPage.php b/includes/EditPage.php
index e88baaf..ee67d01 100644
--- a/includes/EditPage.php
+++ b/includes/EditPage.php
@@ -3464,6 +3464,8 @@
                global $wgOut, $wgUser, $wgRawHtml, $wgLang;
                global $wgAllowUserCss, $wgAllowUserJs;
 
+               $stats = $wgOut->getContext()->getStats();
+
                if ( $wgRawHtml && !$this->mTokenOk ) {
                        // Could be an offsite preview attempt. This is very 
unsafe if
                        // HTML is enabled, as it could be an attack.
@@ -3475,6 +3477,7 @@
                                $parsedNote = $wgOut->parse( "<div 
class='previewnote'>" .
                                        wfMessage( 'session_fail_preview_html' 
)->text() . "</div>", true, /* interface */true );
                        }
+                       $stats->increment( 'edit.failures.session_loss' );
                        return $parsedNote;
                }
 
@@ -3498,11 +3501,16 @@
                        if ( $this->mTriedSave && !$this->mTokenOk ) {
                                if ( $this->mTokenOkExceptSuffix ) {
                                        $note = wfMessage( 
'token_suffix_mismatch' )->plain();
+                                       $stats->increment( 
'edit.failures.bad_token' );
                                } else {
                                        $note = wfMessage( 
'session_fail_preview' )->plain();
+                                       $stats->increment( 
'edit.failures.session_loss' );
                                }
                        } elseif ( $this->incompleteForm ) {
                                $note = wfMessage( 'edit_form_incomplete' 
)->plain();
+                               if ( $this->mTriedSave ) {
+                                       $stats->increment( 
'edit.failures.incomplete_form' );
+                               }
                        } else {
                                $note = wfMessage( 'previewnote' )->plain() . ' 
' . $continueEditing;
                        }

-- 
To view, visit https://gerrit.wikimedia.org/r/217749
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c99f292002209cf2bf4376f97b8c70a6b1ec021
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to