mozilla-b2g/gaia — pull request #11911 by mcav (2013-09-03 18:27:18+00:00)
Title: Bug 883464 - [email/IMAP] Have imap.js stop entering IDLE state, avoid spamming non-IDLE servers with NOOPs. r=asuth

- We're removing the logic that triggers the IDLE or NOOP commands. The logic was located in the "hey, we're all done with this request, let's shift it off and call its callback and stuff" region of the mega-function.

- Our isUnsolicited logic will never return true, but this doesn't matter because we never consumed the generated data anyways.

- We still set isIdle, but nothing cares. (The isUnsolicited logic checks it, but the ext.idle.state stuff will never change.)

- The noop/idle timers and associated logic has been removed.

- Since we really didn't intend to be using NOOP/IDLE, we had no unit test coverage of this, so there's really no unit tests to update other than the change in timer resets that occur. (This might potentially fix one or two of our suspicious intermittent failures since the IDLE commands could conceivably be interacting.)

- In terms of user impact, our connections may time-out and be disconnected by the server somewhat more frequently now, but overall we expect a bandwidth/cpu/battery win. Probably the most noticeable difference would be for servers like dovecot which have a setting like imap_idle_notify_interval that periodically sends an unsolicited string for NAT/other keep-alive purposes every ~2 minutes.