mirror of
https://github.com/chatmail/core.git
synced 2026-04-17 21:46:35 +03:00
maybe_add_time_based_warnings(): Use release date instead of the provider DB update one (#4213)
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 :)
This commit is contained in:
@@ -233,7 +233,7 @@ if __name__ == "__main__":
|
||||
else:
|
||||
now = datetime.datetime.fromisoformat(sys.argv[2])
|
||||
out_all += (
|
||||
"pub static PROVIDER_UPDATED: Lazy<chrono::NaiveDate> = "
|
||||
"pub static _PROVIDER_UPDATED: Lazy<chrono::NaiveDate> = "
|
||||
"Lazy::new(|| chrono::NaiveDate::from_ymd_opt("
|
||||
+ str(now.year)
|
||||
+ ", "
|
||||
|
||||
Reference in New Issue
Block a user