fix(seatool deletes): When a record is deleted in seatool, it should be deleted from our system. #370
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This adds support for seatool delete events. When a record is deleted in seatool, it is deleted in our system and is no longer visible.
Linked Issues to Close
Closes https://qmacbis.atlassian.net/browse/OY2-27186
Approach
We had deferred the handling of seatool events until we had a better understanding of what was wanted.
This now adds support for seatool delete events.
On delete
It appears that we had already tried to implement this logic, but a 'return' in the place where a 'continue' should be was causing the null record to not be sent to opensearch.
Difference between return and continue here:
Using return:
When a record with no value is encountered, it logs the delete event and then immediately exits the function. This is significant because it means that no further processing will occur for any remaining records within the same recordKey group or any other groups.
This early exit from the function could lead to incomplete processing of data if there are multiple records to be processed.
Using continue:
The continue keyword is used inside the first loop when a record with no value is encountered, indicating a delete event. This causes the loop to skip the current iteration and move on to the next iteration of the loop.
This means that after logging the delete event, the code will continue processing any remaining records within the same recordKey group.
Assorted Notes/Considerations/Learning
None