Skip to content

Conversation

@cbs228
Copy link
Owner

@cbs228 cbs228 commented Sep 1, 2025

Previous versions of sameplace erroneously stated that the expiration time of a SAME message was

issue datetime + purge duration

This is almost correct, but there's a catch:

  • the expiration time is rounded to the nearest 15 minute increment for durations ≤1 hour

  • the expiration time is rounded to the nearest 30 minute increment for longer-duration messages

  • the maximum duration of a SAME message is 99.5 hours 1

Add MessageHeader::purge_datetime() to calculate this time, and fix the incorrect Message::is_expired_at() implementation to match. Documentation is given a touch-up.

This is an API-expanding change for sameold and will change samedec's SAMEDEC_PURGETIME values.

cbs228 added 3 commits August 31, 2025 20:27
Fix erroneous documentation on `MessageHeader::is_expired_at()`.

* The maximum duration of SAME messages is 99.5 hours [1]…

* … And we only need to be within ±90 days anyway.

[1]: https://www.weather.gov/nwr/samealertduration
Previous versions of sameplace erroneously stated that the
expiration time of a SAME message was

    issue datetime + purge duration

This is *almost* correct, but there's a catch:

* the expiration time is rounded to the nearest 15 minute
  increment for durations ≤1 hour

* the expiration time is rounded to the nearest 30 minute
  increment for longer-duration messages

Add `MessageHeader::purge_datetime()` to calculate this time, and
fix the incorrect `Message::is_expired_at()` implementation to
match. Documentation is given a touch-up.
Source the purge time from `MessageHeader::purge_datetime()`
instead of calculating it directly. The rounding behavior will
change the output.
@cbs228 cbs228 self-assigned this Sep 1, 2025
@cbs228 cbs228 added bug Something isn't working enhancement New feature or request sameold Applies to sameold library samedec Applies to samedec binary labels Sep 1, 2025
@cbs228 cbs228 merged commit 0931b8a into develop Sep 1, 2025
10 checks passed
@cbs228 cbs228 deleted the feature/purge_time_15m branch September 1, 2025 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request samedec Applies to samedec binary sameold Applies to sameold library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants