mirror of
https://github.com/chatmail/core.git
synced 2026-04-06 07:32:12 +03:00
bjoern <r10s@b44t.com> wrote: > maybe_add_time_based_warnings() requires some date guaranteed to be in the near past. based on this known date we check if the system clock is wrong (if earlier than known date) and if the used Delta Chat version may be outdated (1 year passed since known date). while this does not catch all situations, it catches quite some errors with comparable few effort. > > figuring out the date guaranteed to be in the near past is a bit tricky. that time, we added get_provider_update_timestamp() for exactly that purpose - it is checked manually by some dev and updated from time to time, usually before a release. > > however, meanwhile, the provider-db gets updated less frequently - things might be settled a bit more - and, get_provider_update_timestamp() was also changed to return the date of the last commit, instead of last run. while that seem to be more on-purpose, we cannot even do an “empty” database update to update the known date. > > as get_provider_update_timestamp() is not used for anything else, maybe we should completely remove that function and replace it by get_last_release_timestamp that is then updated by ./scripts/set_core_version.py - the result of that is reviewed manually anyway, so that seems to be a good place (i prefer manual review here and mistrust further automation as also dev or ci clocks may be wrong :)
11 lines
267 B
Rust
11 lines
267 B
Rust
//! DC release info.
|
|
|
|
use chrono::NaiveDate;
|
|
use once_cell::sync::Lazy;
|
|
|
|
const DATE_STR: &str = include_str!("../release-date.in");
|
|
|
|
/// Last release date.
|
|
pub static DATE: Lazy<NaiveDate> =
|
|
Lazy::new(|| NaiveDate::parse_from_str(DATE_STR, "%Y-%m-%d").unwrap());
|