33

Attempting to delete questions on the mobile site on iOS causes two notification messages asking me to confirm the deletion, which it shouldn't do.

I haven't really looked into it, but it may just be that the handlers from full.js and mobile.js are both being triggered, as there seems to be the flash of the error dialog indicating something went wrong on the supposed second AJAX request when the response from the first triggers a page reload.

You can see this happening by following the method calls; the mobile view first calls

StackExchange.question.init()
-> StackExchange.question.fullInit()
  -> StackExchange.vote.init()
    -> u() 

...where u() sets a delegated click handler on

$("div.post-menu *[id^='delete-post-'], table.flagged-posts *[id^='delete-post-']")

...that calls .preventDefault() on the event, but doesn't block other handlers from firing.

It then later calls StackExchange.mobile.init(), which in turn calls the method J() that sets up a similar handler directly on $(".delete-post").

Since both handlers get triggered, there's two confirmation dialogs, and two attempts to delete the post. The extra handler in mobile.js seems unnecessary, so just removing it would appear to be the easy fix to the problem.

4
  • 25
    But you're sure, right?
    – Bart
    Jun 14, 2013 at 19:39
  • I don't think this is clear enough. You didn't want to delete, did you? That would be a bad thing. Jun 14, 2013 at 20:11
  • If you didn't want to delete it, you might want to look into mobile browsers not supporting websockets, and polling producing duplicate responses at times. A spinning lock can go a long ways sometimes.
    – Travis J
    Jun 14, 2013 at 23:38
  • 5
    This is so you can't claim you deleted it accidentally. Jul 1, 2013 at 4:35

1 Answer 1

9

I also stumbled upon the same bug when doing localization prep work on those views.

The fixed was shipped in build 2013.8.26.1380 (meta) / 2013.8.26.973 (sites)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .