Connect saved machines concurrently in the chat workspace

This commit is contained in:
2026-11-08 22:21:17 +00:00
parent 663d5fb5c9
commit e4904395f0
44 changed files with 2574 additions and 60 deletions
@@ -35,13 +35,38 @@ Map<String, dynamic>? requestOf(
.skip(index)
.firstOrNull;
final _fixtureAutomationReplies = Expando<Set<String>>();
Future<Map<String, dynamic>> waitForRequest(
WidgetTester tester,
FakeChannel channel,
String type, {
int index = 0,
}) async {
final replied = _fixtureAutomationReplies[channel] ??= <String>{};
for (var attempt = 0; attempt < 80; attempt++) {
// Automation metadata is independently requested before history. This
// fixture has no provider schedules; answer unavailable rather than leave
// the correlated transport blocked behind an unanswered request.
if (type != 'chat_automations') {
for (final raw in channel.outgoing.toList()) {
final metadata = jsonDecode(raw as String) as Map<String, dynamic>;
if (metadata['type'] == 'chat_automations' &&
replied.add('${metadata['id']}')) {
channel.incoming.add(
jsonEncode({
'id': metadata['id'],
'type': 'chat_automations',
'chat_automations': {
'session_id': metadata['chat_query']['session_id'],
'provider': 'fixture',
'status': 'unavailable',
},
}),
);
}
}
}
final request = requestOf(channel, type, index: index);
if (request != null) return request;
await tester.pump(const Duration(milliseconds: 5));
@@ -226,6 +251,7 @@ void main() {
await tester.pumpWidget(
PipelinesApp(
androidSupported: false,
server: webServer(),
client: client,
cupertino: cupertino,
@@ -351,6 +377,7 @@ void main() {
await tester.pumpWidget(
PipelinesApp(
androidSupported: false,
server: webServer(),
client: client,
cupertino: false,
@@ -559,6 +586,7 @@ void main() {
addTearDown(client.dispose);
await tester.pumpWidget(
PipelinesApp(
androidSupported: false,
server: webServer(),
client: client,
cupertino: false,
@@ -641,6 +669,7 @@ void main() {
addTearDown(client.dispose);
await tester.pumpWidget(
PipelinesApp(
androidSupported: false,
server: webServer(),
client: client,
cupertino: false,
@@ -710,6 +739,7 @@ void main() {
addTearDown(client.dispose);
await tester.pumpWidget(
PipelinesApp(
androidSupported: false,
server: webServer(),
client: client,
cupertino: false,
@@ -35,6 +35,7 @@ void main() {
(tester) async {
await tester.pumpWidget(
PipelinesRoot(
federatedChats: false,
nativeUpdatesSupported: false,
server: _server(''),
buildDefault: 'wss://build.example/connect',
@@ -55,6 +56,7 @@ void main() {
) async {
await tester.pumpWidget(
PipelinesRoot(
federatedChats: false,
nativeUpdatesSupported: false,
server: _server('wss://home.example/connect'),
// A saved server with no kept session goes to onboarding directly.
@@ -336,6 +336,7 @@ Future<void> pumpApp(
}) async {
await tester.pumpWidget(
PipelinesApp(
androidSupported: false,
server: webServer(),
client: client,
cupertino: cupertino,
@@ -51,6 +51,8 @@ void main() {
);
await tester.pumpWidget(
PipelinesRoot(
federatedChats: false,
nativeUpdatesSupported: false,
server: ServerEndpoint.resolve(
base: Uri.parse('file:///'),
web: false,
@@ -57,6 +57,7 @@ void main() {
await ServerSession.load();
await tester.pumpWidget(
PipelinesRoot(
federatedChats: false,
nativeUpdatesSupported: false,
server: ServerEndpoint.resolve(
base: Uri.parse('file:///'),
@@ -120,6 +121,7 @@ void main() {
);
await tester.pumpWidget(
PipelinesRoot(
federatedChats: false,
nativeUpdatesSupported: false,
server: server,
catalogStore: store,
@@ -209,6 +211,7 @@ void main() {
);
await tester.pumpWidget(
PipelinesRoot(
federatedChats: false,
nativeUpdatesSupported: false,
server: ServerEndpoint.resolve(
base: Uri.parse('file:///'),