-
-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance profile setup: add cached/creating indicators, parallelize creation, and show online progress #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…tion - Rename AccountMaker to ProfileMaker and all related variables - Add is_cached detection in get_relay_profile method - Update progress messages to show cached vs creating status - Parallelize receiver profile setup using threads - Keep deltachat-rpc API calls unchanged (get_all_accounts, add_account) Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
- Add lock to ProfileMaker to prevent race conditions during profile lookup/creation - Move start_io() call outside lock to allow true parallelization - Fix nonlocal declaration placement in setup_receiver_profile - Add comments explaining thread-safety approach Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
- Clarify that cached profiles are those found in existing accounts - Explain that multiple profiles per domain are supported (for receivers) - Document why start_io() is called outside the lock (parallelization) - Improve comments in setup_receiver_profile to explain behavior Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
|
@copilot print progress bar for accounts coming online, and print the precise number instead of "all profiles". Show any error output that arrives via events. Read https://py.delta.chat for documentation of events. |
- Display precise count: "Waiting for N profile(s) to come online: X/N" - Show ERROR events during profile setup with detailed messages - Show WARNING events during profile setup - Update progress counter in real-time as profiles come online - Remove redundant "Waiting for all profiles" generic message Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
Done in commit 6f789d0. The wait_all_online method now:
Example output: If errors occur during setup, they're displayed inline: |
- Remove lock from _add_online: Python list.append() is atomic - Keep lock in get_relay_profile: prevents race condition where multiple threads select same cached profile - Add detailed comments explaining why lock is needed in get_relay_profile - Clarify that deltachat-rpc-server handles all API calls thread-safely - Extract print_progress helper to reduce code duplication Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
- Clarify that len() and list copy are atomic operations in Python - Document that timeout handling is done at caller level - Explain that list copy avoids concurrent modification issues Co-authored-by: hpk42 <73579+hpk42@users.noreply.github.com>
Profile setup progress was opaque and sequential. Users couldn't distinguish between cached profile reuse and fresh creation, multiple profiles were created serially, and there was no visibility into profiles coming online.
Changes
Progress indicators
get_relay_profile()now returns(profile, is_cached)tuple"Setting up profiles: X/Y (cached: A, creating: B)""Waiting for N profile(s) to come online: X/N"with real-time updatesParallelization
ProfileMaker.lockto prevent race conditionsstart_io()(the I/O-bound bottleneck) executes outside lock for true parallelizationEvent handling
Terminology
AccountMaker→ProfileMaker,get_relay_account→get_relay_profileget_all_accounts(),add_account(),accounts_dirunchangedOptimized thread safety
_add_online()(Pythonlist.append()is atomic)get_relay_profile()to prevent duplicate profile selectionImplementation
Threading strategy: serialize fast atomic operations (profile lookup/creation), parallelize slow I/O operations (
start_io()). Minimal locking leverages Python's atomic operations and deltachat-rpc-server's thread safety.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.