Skip to content

Commit

Permalink
fix: raise lower auto-download limit to 160k
Browse files Browse the repository at this point in the history
  • Loading branch information
r10s authored and link2xt committed Nov 7, 2023
1 parent 14adcdb commit 2895278
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions python/tests/test_1_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def test_webxdc_download_on_demand(acfactory, data, lp):

lp.sec("ac2 sets download limit")
ac2.set_config("download_limit", "100")
assert msg1.send_status_update({"payload": base64.b64encode(os.urandom(50000))}, "some test data")
assert msg1.send_status_update({"payload": base64.b64encode(os.urandom(300000))}, "some test data")
ac2_update = ac2._evtracker.wait_next_incoming_message()
assert ac2_update.download_state == dc.const.DC_DOWNLOAD_AVAILABLE
assert not msg2.get_status_updates()
Expand Down Expand Up @@ -1445,7 +1445,7 @@ def test_reaction_to_partially_fetched_msg(acfactory, lp, tmp_path):
message, then processes a partially downloaded message.
- As a result, Bob does not see a reaction
"""
download_limit = 32768
download_limit = 300000
ac1, ac2 = acfactory.get_online_accounts(2)
ac1_addr = ac1.get_config("addr")
chat = ac1.create_chat(ac2)
Expand Down
11 changes: 5 additions & 6 deletions src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ use crate::{stock_str, EventType};

/// Download limits should not be used below `MIN_DOWNLOAD_LIMIT`.
///
/// Some messages as non-delivery-reports (NDN) or read-receipts (MDN)
/// need to be downloaded completely to handle them correctly,
/// eg. to assign them to the correct chat.
/// As these messages are typically small,
/// they're caught by `MIN_DOWNLOAD_LIMIT`.
pub(crate) const MIN_DOWNLOAD_LIMIT: u32 = 32768;
/// For better UX, some messages as add-member, non-delivery-reports (NDN) or read-receipts (MDN)
/// should always be downloaded completely to handle them correctly,
/// also in larger groups and if group and contact avatar are attached.
/// Most of these cases are caught by `MIN_DOWNLOAD_LIMIT`.
pub(crate) const MIN_DOWNLOAD_LIMIT: u32 = 163840;

/// If a message is downloaded only partially
/// and `delete_server_after` is set to small timeouts (eg. "at once"),
Expand Down

0 comments on commit 2895278

Please sign in to comment.