···2323- Whenever the `lastUpdated` field from the API is updated to a NEW time, it means there's NEW alerts.
2424- Whenever a specific alert or alerts are updated, the `lastUpdated` changes but it's changed to whatever the timestamp was when the initial alert was updated. So this could be a timestamp in the past.
25252626-<aside class="bg-blue-200 border-l-4 text-blue-900 p-2 border-blue-600">Ex. NEW alert timestamp saved with <b>'2024-06-24T01:57:45.606Z'</b>, another NEW update saved with <b>'2024-06-24T01:58:30.100Z'</b>. A content only update to a previous alert changes the `lastUpdated` back to <b>'2024-06-24T01:57:45.606Z'</b> in the API and because I was comparing the data in my cache with the key of <b>'2024-06-24T01:57:45.606Z'</b> versus what was being returned from the API with `lastUpdated` as this value <b>'2024-06-24T01:57:45.606Z'</b>, the IDs would be the exact same. The content however was different.</aside>
2626+<aside class="bg-blue-200 border-l-4 text-blue-900 p-2 border-blue-600">
2727+ Ex. NEW alert timestamp saved with <b>'2024-06-24T01:57:45.606Z'</b>, another
2828+ NEW update saved with <b>'2024-06-24T01:58:30.100Z'</b>. A content only update
2929+ to a previous alert changes the `lastUpdated` back to{" "}
3030+ <b>'2024-06-24T01:57:45.606Z'</b> in the API and because I was comparing the
3131+ data in my cache with the key of <b>'2024-06-24T01:57:45.606Z'</b> versus what
3232+ was being returned from the API with `lastUpdated` as this value{" "}
3333+ <b>'2024-06-24T01:57:45.606Z'</b>, the IDs would be the exact same. The
3434+ content however was different.
3535+</aside>
27362837Initially I was just checking the cache with the key being whatever the `lastUpdated` was at the time of fetching the data from the API. All good and dandy except when the second situation from above happened, it meant I was comparing a previously saved list of alerts versus whatever was coming back from the API. Which because it was using a `lastUpdated` timestamp that already existed, just comparing based on the IDs wouldn't work. Whenever there are content updates there are no NEW ids, the same ID for an alert is reused and the content is updated. I had to ALSO check the content to see if any of them have changed. It was simple enough, I just copied the logic for checking for new IDs but applied it to check for new content based on the alert titles.
2938