newrelic/rpm — pull request #92 by chendo (2012-12-13 05:36:01+00:00)
Title: Fix multiple application IDs with Real User Monitoring

We found a bug in the 3.5.3.25 agent where having multiple application names defined in the configuration fail will push an invalid set of arguments on to the `NREUMQ queue`.

Having multiple application names would cause config[:application_id] to contain a string of application IDs, separated by commas, which causes the JS to interpret it as multiple arguments, and thus shifting the order so the tracking script won't send the right params to the beacon. In our case, `3` is used instead of `new Date().getTime()` which causes it to send back the `dc` (domContent) parameter as a negative value. The beacon is probably discarding invalid looking data.

Example:
```ruby
# v3.5.3.25
NREUMQ.push(["nrfj", "beacon-1.newrelic.com", "fcf8d519de", 13909, 933593, 716468, "", 3, 80, new Date().getTime(), "", "", "", "", ""]);

# v3.3.2.1
NREUMQ.push(["nrfj","beacon-1.newrelic.com", "a239117ea5", 12250, "", 49, 37 ,new Date().getTime(),"","","","",""]);
````

This PR contains fix with a matching test that ensures that it only includes the first application ID in the JS back, given that it does not appear that the JS supports multiple application IDs.