ezmobius / nanite

self assembling fabric of ruby daemons
Apache License 2.0
735 stars 64 forks source link

Bug in mapper.rb where options are passed as wrong parameter (size) #5

Closed joshwilsdon closed 14 years ago

joshwilsdon commented 15 years ago

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.

roidrage commented 15 years ago

The same issue exists for deliverables assembled in and sent from agents. We're currently working on a fix.

roidrage commented 14 years ago

Been long fixed. Time for a close.