LucasWerkmeister added a comment.

  I’ve looked into this a little bit. As far as I can tell, it //should// work 
in principle – PHP sets the `status` field in the database to `STOP`, and Rust 
only selects batches with certain statuses, not including `STOP`.
  
  But I think the JS side is missing some error handling. PHP will attach an 
error message to the JSON response (`"status"` field), but it’s not read as far 
as I can tell:
  
    $.post ( me.api , {
     action:'stop_batch',
     batch:me.meta.batch.id
    } , function ( d ) {
     $('#working').hide() ;
     me.loadBatchInfo(me.meta.batch.id) ;
    } , 'json' ) ;
  
  (This code is from the Vue component, but the non-Vue version seems to behave 
similarly.) So if the PHP side failed to stop the batch for any reason, then I 
think the JS side would still have removed the “stop” button and otherwise 
acted as if the batch was successfully stopped.

TASK DETAIL
  https://phabricator.wikimedia.org/T232960

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Magnus, LucasWerkmeister
Cc: LucasWerkmeister, Aklapper, Harmonia_Amanda, darthmon_wmde, DannyS712, 
Nandana, AndyTan, Zylc, 1978Gage2001, Lahi, Gq86, GoranSMilovanovic, 
Jayprakash12345, Chicocvenancio, QZanden, Tbscho, LawExplorer, JJMC89, _jensen, 
rosalieper, srodlund, Wikidata-bugs, Jitrixis, aude, Gryllida, scfc, Mbch331, 
Krenair, chasemp
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to