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,