[#83107] Alias Enumerable#include? to Enumerable#includes? — Alberto Almagro <albertoalmagro@...>

Hello,

9 messages 2017/10/04

[ruby-core:83554] [Ruby trunk Bug#14051] net/imap issue on idle method with an empty block

From: simayosi@...
Date: 2017-10-25 03:44:02 UTC
List: ruby-core #83554
Issue #14051 has been reported by simayosi (SHIMAYOSHI Takao).

----------------------------------------
Bug #14051: net/imap issue on idle method with an empty block
https://bugs.ruby-lang.org/issues/14051

* Author: simayosi (SHIMAYOSHI Takao)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
Description
If Net::IMAP#idle method is called with empty block,  all response handlers that have added beforehand are unintentionally removed before returning from the call.

Sample Code
  imap.add_response_handler do |resp|
    if resp.kind_of?(Net::IMAP::UntaggedResponse) and resp.name == "EXISTS"
      imap.idle_done
    end
  end
  imap.idle {}
  # the response handler firstly added is unregistered here

Cause
@response_handlers.delete(nil) is executed in Net::IMAP#remove_response_handler called from the idle method.




-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next