Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ pub const DC_GCL_ADDRESS: u32 = 0x04;
pub(crate) const DC_RESEND_USER_AVATAR_DAYS: i64 = 14;

// warn about an outdated app after a given number of days.
// as we use the "provider-db generation date" as reference (that might not be updated very often)
// and as not all system get speedy updates,
// reference is the release date.
// as not all system get speedy updates,
// do not use too small value that will annoy users checking for nonexistent updates.
pub(crate) const DC_OUTDATED_WARNING_DAYS: i64 = 365;
pub(crate) const DC_OUTDATED_WARNING_DAYS: i64 = 183;

/// messages that should be deleted get this chat_id; the messages are deleted from the working thread later then. This is also needed as rfc724_mid should be preset as long as the message is not deleted on the server (otherwise it is downloaded again)
pub const DC_CHAT_ID_TRASH: ChatId = ChatId::new(3);
Expand Down
5 changes: 2 additions & 3 deletions src/tools/tools_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,10 @@ async fn test_maybe_warn_on_outdated() {
let t = TestContext::new().await;
let timestamp_now: i64 = time();

// in about 6 months, the app should not be outdated
// (if this fails, provider-db is not updated since 6 months)
// in about 3 months, the app should not be outdated
maybe_warn_on_outdated(
&t,
timestamp_now + 180 * 24 * 60 * 60,
timestamp_now + 90 * 24 * 60 * 60,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be DC_OUTDATED_WARNING_DAYS - 1 instead of 90? As to me, it looks correct to use constants in tests. This is a test on the warning logic, not on the constant value

Copy link
Contributor Author

@r10s r10s Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see that also as a test for reasonable value

testing that 90 days are not outdated makes sense, as we had that as an issue in the past and we do not want a regression

but there could be a another test for DC_OUTDATED_WARNING_DAYS - 1

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not clear why 90 days is a reasonable value and, say, 10 isn't, w/o a comment describing the issue. Currently nothing protects a random contributor from decreasing both values

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i created a PR adding a comment at #7155

get_release_timestamp(),
)
.await;
Expand Down
Loading