This code verifies that the signal index exists (and sets an error if not), but that happens once for each rule being imported.
Additionally, if the index does not exist, we still try to upsert the rule, which seems like it may actually succeed.
There may be a few bugs here, but I think that the solution is to move the indexExists check outside of the loop and exit early, similar to how we handle a parsing error
This code verifies that the signal index exists (and sets an error if not), but that happens once for each rule being imported.
Additionally, if the index does not exist, we still try to upsert the rule, which seems like it may actually succeed.
There may be a few bugs here, but I think that the solution is to move the indexExists check outside of the loop and exit early, similar to how we handle a parsing error