Repeater screens query the mesh only on request
Opening a repeater's settings, status, telemetry or neighbours no longer sends anything over the mesh; each screen waits for its refresh button. On the settings screen alone the fetch-on-open was a dozen CLI requests, every time it was opened. Switch: kFetchRemoteOnOpen in lib/tth_fork.dart. The node's own telemetry is local and still loads on open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
36806e289d
commit
71884e269f
5 files changed
+15
-4
No files matched your search
@@ -17,6 +17,7 @@ import '../helpers/snack_bar_builder.dart';
|
||||
import '../l10n/app_localizations.dart';
|
||||
import '../widgets/repeater_login_dialog.dart';
|
||||
import 'repeater_hub_screen.dart';
|
||||
import '../tth_fork.dart';
|
||||
|
||||
class NeighborsScreen extends StatefulWidget {
|
||||
final Contact repeater;
|
||||
@@ -78,7 +79,7 @@ class _NeighborsScreenState extends State<NeighborsScreen> {
|
||||
final connector = Provider.of<MeshCoreConnector>(context, listen: false);
|
||||
_commandService = RepeaterCommandService(connector);
|
||||
_setupMessageListener();
|
||||
_loadNeighbors();
|
||||
if (kFetchRemoteOnOpen) _loadNeighbors();
|
||||
_hasData = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import '../widgets/radio_disconnected_banner.dart';
|
||||
import '../widgets/routing_sheet.dart';
|
||||
import '../utils/keys.dart';
|
||||
import '../helpers/snack_bar_builder.dart';
|
||||
import '../tth_fork.dart';
|
||||
|
||||
class RepeaterSettingsScreen extends StatefulWidget {
|
||||
final Contact repeater;
|
||||
@@ -221,7 +222,7 @@ class _RepeaterSettingsScreenState extends State<RepeaterSettingsScreen> {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
final connector = Provider.of<MeshCoreConnector>(context, listen: false);
|
||||
if (connector.isConnected) _refreshAll();
|
||||
if (kFetchRemoteOnOpen && connector.isConnected) _refreshAll();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import '../utils/battery_utils.dart';
|
||||
import '../widgets/mesh_ui.dart';
|
||||
import '../widgets/radio_disconnected_banner.dart';
|
||||
import '../widgets/routing_sheet.dart';
|
||||
import '../tth_fork.dart';
|
||||
|
||||
class RepeaterStatusScreen extends StatefulWidget {
|
||||
final Contact repeater;
|
||||
@@ -70,7 +71,7 @@ class _RepeaterStatusScreenState extends State<RepeaterStatusScreen> {
|
||||
_commandService = RepeaterCommandService(connector);
|
||||
_setupMessageListener();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) _loadStatus();
|
||||
if (mounted && kFetchRemoteOnOpen) _loadStatus();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import '../widgets/sync_progress_overlay.dart';
|
||||
import '../widgets/telemetry_location_map.dart';
|
||||
import '../theme/mesh_theme.dart';
|
||||
import '../widgets/mesh_ui.dart';
|
||||
import '../tth_fork.dart';
|
||||
|
||||
/// Opens the telemetry screen for the locally connected node.
|
||||
void pushSelfTelemetryScreen(BuildContext context) {
|
||||
@@ -115,7 +116,8 @@ class _TelemetryScreenState extends State<TelemetryScreen> {
|
||||
_commandService = RepeaterCommandService(connector);
|
||||
_loadAutoRefreshSettings();
|
||||
_setupMessageListener();
|
||||
_loadTelemetry();
|
||||
// The node's own telemetry is local, no mesh traffic.
|
||||
if (kFetchRemoteOnOpen || widget.isSelf) _loadTelemetry();
|
||||
_hasData = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,3 +5,9 @@ library;
|
||||
/// image codec cannot work, so their settings - and the model downloads
|
||||
/// behind them - are hidden.
|
||||
const bool kOnDeviceMl = false;
|
||||
|
||||
/// Opening a repeater/room screen (settings, status, telemetry, neighbours)
|
||||
/// does NOT query the node over the mesh: each screen waits for its refresh
|
||||
/// button. Upstream fetches on open, which on the settings screen alone is a
|
||||
/// burst of a dozen CLI requests through the mesh - every time it is opened.
|
||||
const bool kFetchRemoteOnOpen = false;
|
||||
Reference in new issue
Block a user