| @@ -133,11 +133,14 @@ | ||
| 133 | 133 | * @returns {boolean} |
| 134 | 134 | */ |
| 135 | 135 | function do_agents_match(agent1, agent2) { |
| 136 | 136 | var command_matches = agent1.command === agent2.command; |
| 137 | + var subaction1 = agent1.command_data && agent1.command_data.subaction ? agent1.command_data.subaction : undefined; | |
| 138 | + var subaction2 = agent2.command_data && agent2.command_data.subaction ? agent2.command_data.subaction : undefined; | |
| 139 | + var subaction_matches = subaction1 === subaction2; | |
| 137 | 140 | var command_not_sent_yet = false === agent1.sent; |
| 138 | 141 | |
| 139 | - return command_matches && command_not_sent_yet; | |
| 142 | + return command_matches && subaction_matches && command_not_sent_yet; | |
| 140 | 143 | } |
| 141 | 144 | |
| 142 | 145 | /** |
| 143 | 146 | * Add a heartbeat agent that will be sent to backend and has a callback to receive the response |