Corrected issue occurring when a ADD action occurs after a REMOVE action. Previously, the REMOVE would delete the tag from the header, but the field would remain in the fields list. This created an issue with subsequent ADD actions due to the fact that the item would be found in the fields dictionary and would be treated as a replace. After correcting this issue by removing the item from the fields list, it introduced an issue when iterating over the fields dictionary while processing multiple-field actions. To accommodate this the iteration over the fields dictionary was switched to a clone so that the dictionary on which we are iterating would not be changed by potential REMOVE actions.
Checklist
[x] I have commented my code, particularly in hard-to-understand areas
[x] My changes generate no new warnings
[x] My code follows the style guidelines of this project
Open questions
Questions that require more discussion or to be addressed in future development:
Description
Related issues: # 140
Corrected issue occurring when a ADD action occurs after a REMOVE action. Previously, the REMOVE would delete the tag from the header, but the field would remain in the fields list. This created an issue with subsequent ADD actions due to the fact that the item would be found in the fields dictionary and would be treated as a replace. After correcting this issue by removing the item from the fields list, it introduced an issue when iterating over the fields dictionary while processing multiple-field actions. To accommodate this the iteration over the fields dictionary was switched to a clone so that the dictionary on which we are iterating would not be changed by potential REMOVE actions.
Checklist
Open questions
Questions that require more discussion or to be addressed in future development: