@pi-unipi/info-screen 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/info-screen",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Dashboard and module registry for Unipi — configurable info overlay with tabbed groups",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -87,13 +87,21 @@ export class InfoOverlay implements Component {
87
87
  }
88
88
 
89
89
  try {
90
- // Load data for all groups in parallel
91
- const promises = this.groups.map(async (group) => {
92
- const data = await infoRegistry.getGroupData(group.id);
93
- this.groupData.set(group.id, data);
90
+ // Load data for all groups in parallel with timeout
91
+ const loadPromises = this.groups.map(async (group) => {
92
+ try {
93
+ const data = await Promise.race([
94
+ infoRegistry.getGroupData(group.id),
95
+ new Promise<never>((_, reject) => setTimeout(() => reject(new Error('timeout')), 3000)),
96
+ ]);
97
+ this.groupData.set(group.id, data);
98
+ } catch {
99
+ // Use empty data on timeout/error
100
+ this.groupData.set(group.id, {});
101
+ }
94
102
  });
95
103
 
96
- await Promise.all(promises);
104
+ await Promise.all(loadPromises);
97
105
  } catch (error) {
98
106
  this.error = error instanceof Error ? error.message : String(error);
99
107
  }