department-of-veterans-affairs / notification-api

Notification API
MIT License
16 stars 9 forks source link

#1977 Bug: Update to Delivered After Other Status is Assigned #1990

Closed EvanParish closed 2 months ago

EvanParish commented 2 months ago

Description

This changes how we handling updating our notification statuses, so that delivered takes precedence over others.

Note: Setting execution_options on the query was necessary because of an error when attempting run the query stating the query could not be evaluate in python. Setting this option to 'fetch' causes a select query or db returning statement to execute with the update effectively doubling the number of queries executed here. We could set this option to False instead if we want the update to just go through when it's executed instead of having the session state be updated. sqlalchemy docs

issue #1977

How Has This Been Tested?

This will be somewhat tricky to test because part of the reason this change is necessary is because a notification seems to be able to reach another status we consider "final" before reaching a "delivered" status.

Checklist