fsanyoto commited on
Commit
623acbc
·
verified ·
1 Parent(s): 3242ba7

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "current": "7ca983c4e",
3
  "releases": []
4
  }
 
1
  {
2
+ "current": "07a58976c",
3
  "releases": []
4
  }
VERSION CHANGED
@@ -1 +1 @@
1
- 7ca983c4e
 
1
+ 07a58976c
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- 387ba4c4697902242e192252256b6aebe0c97753dc6e7a82e4802fda8cebfe3c
 
1
+ 66b8f2041c47ec87d4ff26442f04e74617722537c61ad4f9716d6bf0c2ff8e80
web/src/home/HomePage.tsx CHANGED
@@ -88,6 +88,8 @@ import type { AutomationTile, DataHomeLocation, HomeFilter, HomeLayout, HomeFold
88
 
89
  // Twin in SheetPage.tsx; this ticket's file fence keeps the timeout local to each chunk.
90
  const FOLDER_WRITE_TIMEOUT_MS = 20000;
 
 
91
 
92
  /** S70-T06 / R24: arithmetic stays here because this lane does not own homeModel. */
93
  export function homePageWindow(itemCount: number, capacity: number, requestedPage: number) {
@@ -344,8 +346,29 @@ function parseHomeView(value: unknown): HomeViewTile | null {
344
  }
345
 
346
  async function readHomeViews(abort?: AbortSignal): Promise<{ views: HomeViewTile[]; unreadCount: number }> {
347
- const response = await fetch(`${API_V1}/nav/views`, { credentials: CREDENTIALS, signal: abort });
348
- const body = await response.json().catch(() => null);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
349
  if (!response.ok) throw new Error(refusalSentence(body, "Views could not be loaded. Reload views to retry."));
350
  if (!Array.isArray(body?.views)) throw new Error("Views could not be loaded. Reload views to retry.");
351
  const rows = (body.views as unknown[]).map(parseHomeView).filter((row): row is HomeViewTile => row !== null);
 
88
 
89
  // Twin in SheetPage.tsx; this ticket's file fence keeps the timeout local to each chunk.
90
  const FOLDER_WRITE_TIMEOUT_MS = 20000;
91
+ // Twin of net/deadline.ts READ_DEADLINE_MS, kept local because verify_home runs this file with stubbed imports.
92
+ const VIEWS_READ_TIMEOUT_MS = 45000;
93
 
94
  /** S70-T06 / R24: arithmetic stays here because this lane does not own homeModel. */
95
  export function homePageWindow(itemCount: number, capacity: number, requestedPage: number) {
 
346
  }
347
 
348
  async function readHomeViews(abort?: AbortSignal): Promise<{ views: HomeViewTile[]; unreadCount: number }> {
349
+ // A stalled server ends in the Views error and its reload action, never a spinner.
350
+ // The deadline covers the body too: aborting the request also ends its body read.
351
+ const controller = new AbortController();
352
+ const forward = () => controller.abort();
353
+ if (abort?.aborted) controller.abort();
354
+ else abort?.addEventListener("abort", forward);
355
+ let expired = false;
356
+ const deadline = setTimeout(() => { expired = true; controller.abort(); }, VIEWS_READ_TIMEOUT_MS);
357
+ let response: Response;
358
+ let body;
359
+ try {
360
+ response = await fetch(`${API_V1}/nav/views`, { credentials: CREDENTIALS, signal: controller.signal });
361
+ body = await response.json().catch(() => {
362
+ if (expired) throw new Error("Views did not load in time. Reload views to retry.");
363
+ return null;
364
+ });
365
+ } catch (error) {
366
+ if (expired) throw new Error("Views did not load in time. Reload views to retry.");
367
+ throw error;
368
+ } finally {
369
+ clearTimeout(deadline);
370
+ abort?.removeEventListener("abort", forward);
371
+ }
372
  if (!response.ok) throw new Error(refusalSentence(body, "Views could not be loaded. Reload views to retry."));
373
  if (!Array.isArray(body?.views)) throw new Error("Views could not be loaded. Reload views to retry.");
374
  const rows = (body.views as unknown[]).map(parseHomeView).filter((row): row is HomeViewTile => row !== null);