Bug in mapper.rb where options are passed as wrong parameter (size)
joshwilsdon opened this issue · 2 comments
In mapper.rb the request function looks like:
request(type, payload = '', opts = {}, &blk)
and then passes the first 3 arguments in the same order to:
build_deliverable(deliverable_type, type, payload, opts)
with deliverable_type == Request. Then build_deliverable passes these arguments directly to:
deliverable_type.new(type, payload, opts)
but the problem is that Request has an initialize function that looks like:
initialize(type, payload, size=nil, opts={})
so the options that were passed in to the original request get passed in as the 'size' parameter, which obviously doesn't work. This causes any :selector or :target to be ignored for example.
In our environment, this was causing problems when we passed the :target option because it was being ignored. Changing the build_deliverable function to make the call:
deliverable_type.new(type, payload, nil, opts)
fixed the issue.
The same issue exists for deliverables assembled in and sent from agents. We're currently working on a fix.
Been long fixed. Time for a close.