feature : multi-profile pooling automatically — pick fastest outbound across all active.#2274
Open
Sifat-mahmud wants to merge 1 commit into
Open
feature : multi-profile pooling automatically — pick fastest outbound across all active.#2274Sifat-mahmud wants to merge 1 commit into
Sifat-mahmud wants to merge 1 commit into
Conversation
… profiles, auto-switch on failure
- ProfileDao: dropped single-active exclusivity in insert/edit/deleteById;
added watchActiveProfiles() (plural) and getActiveProfiles().
- ProfileRepository: added setActive(id, value) and watchActiveProfiles().
- active_profile_notifier.dart: new ActiveProfiles Riverpod notifier (plural);
singular ActiveProfile kept for backward-compat (ChainProfileNotifier, etc.).
- ProfilesNotifier: added toggleActiveProfile(id, value) for the new
per-profile toggle UI; updated deleteProfile to use the plural list.
- merged_config_builder.dart (NEW): pools every active profile's real
outbounds (prefixed ${profileId}::${tag}), strips per-profile
selector/urltest/balancer groups, appends a single top-level urltest
group tagged 'select'. The core's URLTest machinery auto-picks the
lowest-delay outbound across ALL active profiles.
- ConnectionRepository: connect/reconnect now take List<ProfileEntity>,
build the merged config, and pass _merged.json to singbox.start/restart.
Added mergedConfigBuilder dependency.
- ConnectionNotifier: _connectThrottled reads activeProfilesProvider and
bails if empty; the auto-reconnect listener now compares SETS of
profile ids and only reconnects when the active set changes.
- Updated all callers of reconnect (connection_button.dart,
connection_wrapper.dart, config_option_notifier.dart,
profile_notifier.dart) to pass lists.
- ProfileTile: body-tap now calls toggleActiveProfile(id, !active) —
toggles on/off without deactivating others; removed auto-pop-on-success.
- HomePage: shows a 'N active profiles pooled' badge when >1 are active.
- ActiveProxyFooter: strips the ${profileId}:: prefix from the displayed
tag and shows 'via <profile name>' underneath.
- auto_profile_switch_notifier.dart (NEW): watches the active-proxy stream
and deactivates a profile after 3 consecutive url-test rounds where ALL
its outbounds are unreachable (delay == 0 or >= 65000). The connection
notifier then reconnects with the remaining (healthy) profiles — i.e.
the app 'switches to a different profile by itself'.
- Wired AutoProfileSwitchNotifier into ConnectionWrapper.
NOTE: run 'dart run build_runner build --delete-conflicting-outputs' to
regenerate .g.dart files for the new/changed Riverpod notifiers
(ActiveProfiles, AutoProfileSwitchNotifier, mergedConfigBuilderProvider).
awingfield916-tech
approved these changes
Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… profiles, auto-switch on failure
NOTE: run 'dart run build_runner build --delete-conflicting-outputs' to
regenerate .g.dart files for the new/changed Riverpod notifiers
(ActiveProfiles, AutoProfileSwitchNotifier, mergedConfigBuilderProvider).