Currently, record_message_ids(..) tries to record all identifiers per frame. The function uses a dictionary (id_message_map) to store the identifier as key and the corresponding protobuf message as value. The issue here is that duplicate identifiers are not stored in the dictionary but every new object with a recurring identifier just overwrites an existing one with the same identifier. So the is_globally_unique rule (which is evaluated after id_message_map is written) will never evaluate to false. Additionally, the refers_to rule can not be evaluated properly. refers_to should probably evaluate to true if there is a correct object with the given identifier even if there are other objects as well? Currently, the result depends on the order in which the objects are defined.
We should refactor record_message_ids(..) to also store duplicate identifier entries.
Currently,
record_message_ids(..)tries to record all identifiers per frame. The function uses a dictionary (id_message_map) to store the identifier as key and the corresponding protobuf message as value. The issue here is that duplicate identifiers are not stored in the dictionary but every new object with a recurring identifier just overwrites an existing one with the same identifier.So theAdditionally, theis_globally_uniquerule (which is evaluated afterid_message_mapis written) will never evaluate to false.refers_torule can not be evaluated properly.refers_toshould probably evaluate to true if there is a correct object with the given identifier even if there are other objects as well? Currently, the result depends on the order in which the objects are defined.We should refactor
record_message_ids(..)to also store duplicate identifier entries.