Skip to content

Persist Flutter-selected download directory changes#1352

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/fix-default-download-folder
Draft

Persist Flutter-selected download directory changes#1352
Copilot wants to merge 4 commits intomainfrom
copilot/fix-default-download-folder

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

Changing the default download directory in the Flutter settings UI updated the visible field but did not persist the new value. As a result, subsequent downloads continued using the previous directory.

  • Root cause

    • The settings page only persisted downloadDir through onEditComplete.
    • DirectorySelector updated controller.text directly for picker/toggle-driven changes, so those updates never reached the config save path.
  • Flutter persistence fix

    • Added a shared updateDirectorySelection(...) helper in ui/flutter/lib/app/views/directory_selector.dart.
    • Routed all programmatic directory updates through this helper so they:
      • update the text controller consistently
      • preserve cursor state
      • invoke the settings save callback when the value actually changes
  • Covered selection paths

    • Desktop folder picker
    • Android internal/download directory toggle
    • Placeholder insertion into download paths
  • Focused test coverage

    • Added a small Dart test covering:
      • controller update + callback invocation on value change
      • no-op behavior when the selected path matches the current value
void updateDirectorySelection(
  TextEditingController controller,
  String value, {
  VoidCallback? onChanged,
}) {
  if (controller.text == value) return;

  controller.value = controller.value.copyWith(
    text: value,
    selection: TextSelection.collapsed(offset: value.length),
    composing: TextRange.empty,
  );
  onChanged?.call();
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 239.255.255.250
    • Triggering command: REDACTED, pid is -1 (packet block)
  • dht.aelitis.com
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • dht.anacrolix.link
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • dht.libtorrent.org
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • dht.transmissionbt.com
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • explodie.org
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • github.com.git
    • Triggering command: /tmp/go-build2045490060/b881/rest.test /tmp/go-build2045490060/b881/rest.test -test.testlogfile=/tmp/go-build2045490060/b881/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • https://api.github.com/repos/GopeedLab/gopeed/releases/latest
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (http block)
  • ipv4.tracker.harry.lu
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • ipv6.torrent.ubuntu.com
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • non-existent-host-12345.example
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • open.stealth.si
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • opentor.org
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • p4p.arenabg.com
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • router.bittorrent.cloud
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • router.bittorrent.com
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • router.silotis.us
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • router.utorrent.com
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • torrent.ubuntu.com
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
    • Triggering command: /tmp/go-build2045490060/b866/download.test /tmp/go-build2045490060/b866/download.test -test.testlogfile=/tmp/go-build2045490060/b866/testlog.txt -test.paniconexit0 -test.timeout=10m0s -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -pie -z (dns block)
  • tracker.birkenwald.de
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • tracker.bitsearch.to
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • tracker.cyberia.is
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • tracker.dler.org
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • tracker.files.fm
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • tracker.foreverpirates.co
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • tracker.moeking.me
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • tracker.opentrackr.org
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • tracker.tiny-vps.com
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • tracker.torrent.eu.org
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)
  • uploads.gamecoast.net
    • Triggering command: /tmp/go-build2045490060/b850/bt.test /tmp/go-build2045490060/b850/bt.test -test.testlogfile=/tmp/go-build2045490060/b850/testlog.txt -test.paniconexit0 -test.timeout=10m0s 5490�� 5490060/b808/_pk-pthread pkg/mod/go4.org@-Wl,--no-gc-sections x64/pkg/tool/lin-fmessage-length=0 -p /minlz -lang=go1.23 R4wGUajbdHRW (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits April 13, 2026 08:07
Copilot AI changed the title [WIP] Fix default download folder setting issue Persist Flutter-selected download directory changes Apr 13, 2026
Copilot AI requested a review from monkeyWie April 13, 2026 08:10
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.27%. Comparing base (d7f6c3b) to head (13d9147).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1352      +/-   ##
==========================================
+ Coverage   71.24%   71.27%   +0.03%     
==========================================
  Files          49       49              
  Lines        6566     6566              
==========================================
+ Hits         4678     4680       +2     
+ Misses       1460     1458       -2     
  Partials      428      428              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

设置了默认的下载文件夹,结果还是原来的。

2 participants