Repository navigation
feat: cc wes workflows rewrite - #61
Conversation
Reviewer's GuideData structuresDefine the TES and WES registry and service-info shapes that the new stores and components rely on.
APIAdd server routes for registry discovery and WES service-info lookup, enforcing endpoint validation and bounded health probes.
Add OIDC login, callback, refresh, logout, user-info, and token endpoints for the new authentication flow.
Uses of the APIConnect UI clients to authenticated WES requests, token refresh, and user identity through the new hooks and provider.
Implement TES and WES selectors, service capability checks, and lazy-loaded task and workflow clients against the selected servers.
ImplementationProvide shared HTTP, timeout, date-formatting, and WES state-label utilities used by the routes and service views.
Render the WES service-info view and its capability, organization, state, and endpoint sections, together with its server-rendered data loader.
UIReplace the application shell and pages with a Next.js login screen, dashboard navigation, task and workflow pages, theme controls, and reusable UI primitives.
Set the root layout, global styles, and home redirect for the Next.js application.
ConfigurationConfigure CI to lint and build with Bun, and deploy the Docker image to OpenShift on master pushes.
Replace the Vite and Yarn project setup with Next.js, Bun, Biome, Tailwind 4, and the new React and service-client dependencies.
DocumentationDocument local setup, OIDC and registry configuration, deployment requirements, and TES/WES workflow examples.
Lock files and vendored codeRecord the Bun dependency resolution for the rewritten application.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 23 issues
Fixed security issues:
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/app/api/workflows/get-service-info/route.ts" line_range="57-62" />
<code_context>
+ );
+
+ if (
+ parsedUrl.protocol !== "https:" ||
+ parsedUrl.username ||
+ parsedUrl.password ||
+ parsedUrl.port ||
+ !isValidPath
+ ) {
+ return NextResponse.json(
+ { error: "Invalid WES service endpoint." },
</code_context>
<issue_to_address>
**Internal services are exposed**
When a registry entry points to a private, loopback, or otherwise internal HTTPS host, the WES probe and service-info route check the URL scheme but not the destination host, so the unauthenticated routes make server-side requests to internal services and the service-info route returns their responses to callers.
Reject private, loopback, and otherwise internal destinations in both handlers before making requests.
Also at `src/app/api/workflows/get-wes-servers/route.ts:42-47`, `src/app/api/workflows/get-service-info/route.ts:70`.
</issue_to_address>
### Comment 2
<location path="src/hooks/use-wes-provider.ts" line_range="17" />
<code_context>
+ const headers = new Headers(init.headers);
+ const token = await this.getToken();
+
+ if (token) {
+ headers.set("Authorization", `Bearer ${token}`);
+ }
</code_context>
<issue_to_address>
**WES servers receive bearer tokens**
When a user selects a registry-listed WES server controlled by an attacker, a malicious operator can list a WES server in the registry and induce a logged-in user to select it. `TokenWesProvider` attaches the user's access token to requests to that server, allowing its operator to capture the bearer token and use it against services that accept it.
Only forward access tokens to explicitly trusted service origins, and clearly identify the destination before authorizing token-bearing requests.
</issue_to_address>
### Comment 3
<location path="src/app/auth/api/refresh/route.ts" line_range="67" />
<code_context>
+ httpOnly: true,
+ };
+
+ const cookieStoreAfter = await cookies();
+ const logoutMarkerAfter = cookieStoreAfter.get("logout_marker")?.value;
+
</code_context>
<issue_to_address>
**Logout leaves sessions active**
When a refresh request is in flight while the user logs out and the refresh response arrives last, the second `cookies()` read sees the refresh request's original cookies, not the marker set by the concurrent logout response. The refresh can therefore return new authentication cookies after logout, leaving the browser signed in.
Prevent an in-flight refresh from issuing usable authentication cookies after a concurrent logout.
Also at `src/app/auth/api/logout/route.ts:35-47`, `src/app/auth/api/refresh/route.ts:68-71`.
</issue_to_address>
### Comment 4
<location path="src/app/auth/api/refresh/route.ts" line_range="27" />
<code_context>
+
+ try {
+ const baseUrl = `${process.env.LS_LOGIN_URL}/oidc/token`;
+ const response = await axiosBase.post(
+ baseUrl,
+ new URLSearchParams({
</code_context>
<issue_to_address>
**Concurrent refreshes end sessions**
When multiple tabs refresh together and the identity provider rotates single-use refresh tokens, both requests submit the same refresh token; after one succeeds, the other receives 401 and the refresh route deletes the token cookies. The user loses the session even though the successful request issued replacement tokens.
Coordinate refreshes across tabs or handle a losing refresh response without deleting tokens issued by the successful exchange.
Also at `src/app/auth/api/refresh/route.ts:101`, `src/app/auth/api/refresh/route.ts:131-144`, `src/hooks/use-token-refresh.ts:24-25`.
</issue_to_address>
### Comment 5
<location path="src/app/auth/api/refresh/route.ts" line_range="133-136" />
<code_context>
+ const shouldClearCookies =
+ axios.isAxiosError(err) && err.response?.status === 401;
+
+ const response = NextResponse.json(
+ { error: "Failed to refresh token" },
+ { status: 401 },
+ );
+
+ if (shouldClearCookies) {
</code_context>
<issue_to_address>
**Temporary outages redirect users**
When the identity provider or network fails during a refresh, the refresh route returns 401 for network and upstream failures, and `useTokenRefresh` redirects on any failed refresh request. A temporary outage therefore sends active users to login instead of preserving the session and retrying.
Distinguish invalid refresh tokens from transient failures and redirect only for an invalid session.
Also at `src/hooks/use-token-refresh.ts:46-47`.
</issue_to_address>
### Comment 6
<location path="src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx" line_range="31-34" />
<code_context>
+ );
+ }
+
+ const baseURL = `${selectedServer.replace(/\/+$/, "")}/ga4gh/tes/v1`;
+
+ return <ECCClientGa4ghTesCreateRuns baseURL={baseURL} />;
</code_context>
<issue_to_address>
**Protected TES services reject requests**
When a selected TES service requires the user's bearer token, both TES wrappers pass only `baseURL` and do not attach the user's access token. The service rejects task-list and submission requests, so users cannot use that TES instance.
Provide the logged-in user's access token to both TES components for their requests.
Also at `src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx:31-33`, `src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx:35`.
</issue_to_address>
### Comment 7
<location path="src/stores/wes.ts" line_range="20" />
<code_context>
+
+ servers: [],
+ serversLoaded: false,
+ setServers: (servers) => set({ servers, serversLoaded: true }),
+}));
</code_context>
<issue_to_address>
**Unusable WES servers remain selected**
When a refresh removes the selected server or marks it unreachable, `setServers` replaces the server list without clearing `selectedServer`, and disabling the selector item does not clear the existing selection. The workflow form continues using that server and submissions fail.
Clear or invalidate the selected server when it is removed or becomes unreachable.
Also at `src/app/dashboard/workflows/_components/wes-server-list.tsx:53-54`, `src/app/dashboard/workflows/_components/wes-server-list.tsx:173`, `src/app/dashboard/workflows/_components/ecc-wes-create-run-wrapper.tsx:35`.
</issue_to_address>
### Comment 8
<location path="src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx" line_range="8" />
<code_context>
+const ECCClientGa4ghTesCreateRuns = dynamic(
+ () =>
+ import("@elixir-cloud/tes/dist/react").then(
+ (mod) => mod.ECCCLientGa4ghTesCreateRun,
+ ),
+ {
</code_context>
<issue_to_address>
**Task creation page crashes**
When a user opens task creation and selects a TES server, the dynamic import looks up `ECCCLientGa4ghTesCreateRun` with an uppercase `L`, unlike the `ECCClient...` export naming used by the TES runs component. The lookup resolves to an undefined component, so the task creation UI fails to render.
Use the create-run component's exact exported name from `@elixir-cloud/tes/dist/react`.
</issue_to_address>
### Comment 9
<location path="src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx" line_range="31" />
<code_context>
+ );
+ }
+
+ const baseURL = `${selectedServer.replace(/\/+$/, "")}/ga4gh/tes/v1`;
+
+ return <ECCClientGa4ghTesCreateRuns baseURL={baseURL} />;
</code_context>
<issue_to_address>
**TES endpoints get duplicated paths**
When a TES registry URL includes its `/ga4gh/tes/v1` API prefix, when a registry entry's `url` already includes the TES API path, both wrappers append `/ga4gh/tes/v1` again, so the component requests a nonexistent nested endpoint and task listing and submission fail.
Normalize the registry URL before passing it to the TES components, appending the API prefix only when it is absent.
Also at `src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx:31`.
</issue_to_address>
### Comment 10
<location path="src/app/dashboard/tasks/_components/tes-server-list.tsx" line_range="108" />
<code_context>
+ className="min-w-87.5 max-w-[min(90vw,480px)]"
+ >
+ <SelectGroup>
+ <SelectItem value="/tes-api">TEST SERVER</SelectItem>
+
+ {servers.map((server) => (
</code_context>
<issue_to_address>
**Test server requests fail**
When a user selects the TEST SERVER option, the TES wrappers build requests under `/tes-api/ga4gh/tes/v1`, but the app has no `/tes-api` route or rewrite. Task listing and submission therefore target a nonexistent path.
Provide a route or rewrite for `/tes-api`, or point TEST SERVER at an available TES endpoint.
Also at `src/app/dashboard/tasks/_components/ecc-tes-run-wrapper.tsx:31`, `src/app/dashboard/tasks/_components/ecc-tes-create-run-wrapper.tsx:31`.
</issue_to_address>
### Comment 11
<location path="src/app/dashboard/workflows/_components/workflow-validator.tsx" line_range="121" />
<code_context>
+ </div>
+ </header>
+ <main className="relative px-4 md:px-8 py-4 h-full overflow-y-auto">
+ {children}
+ </main>
+ </SidebarInset>
</code_context>
<issue_to_address>
**Unsupported workflows reach submission**
When a user selects or submits a workflow type or version absent from the selected server's capabilities, `WorkflowValidator` displays supported types and versions but renders the create form without checking its values. Users can submit unsupported workflows and receive a backend rejection.
Validate the create form's selected type and version against the selected server's capabilities before allowing submission.
Also at `src/app/dashboard/workflows/_components/workflow-validator.tsx:9`, `src/app/dashboard/workflows/_components/workflow-validator.tsx:122`, `src/app/dashboard/workflows/create/page.tsx:35-39`.
</issue_to_address>
### Comment 12
<location path="src/components/shared/app-sidebar/app-topbar-actions.tsx" line_range="21" />
<code_context>
+ <Tooltip>
+ <TooltipTrigger
+ render={
+ <Link href="/dashboard/service-info">
+ <Info className="h-4 w-4" />
+ </Link>
</code_context>
<issue_to_address>
**Service Info link opens missing page**
When a user clicks the top-bar Service Info control, the link points to `/dashboard/service-info`, but the service-info page is at `/dashboard/workflows/service-info`. The link opens a missing page.
Point the top-bar link to `/dashboard/workflows/service-info`.
</issue_to_address>
### Comment 13
<location path="src/app/auth/api/callback/route.ts" line_range="91-96" />
<code_context>
+ maxAge: 60 * 60,
+ });
+
+ if (typeof refresh_token === "string") {
+ responseRedirect.cookies.set("refresh_token", refresh_token, {
+ ...cookieOptions,
+ maxAge: 30 * 24 * 60 * 60,
+ });
+ }
+
+ responseRedirect.cookies.set("token_expires_at", String(expiresAt), {
</code_context>
<issue_to_address>
**Old refresh token survives reauthentication**
When a user reauthenticates while an older refresh-token cookie exists and the identity provider omits `refresh_token` from the new token response, the callback leaves the existing `refresh_token` cookie untouched when the identity provider omits a refresh token, while replacing the access and ID tokens with the new session’s tokens. The refresh endpoint then uses the old session’s token, so reauthenticated users can lose their session or refresh into a different identity.
Clear the existing refresh-token cookie on the callback response whenever the new token response does not provide a replacement.
</issue_to_address>
### Comment 14
<location path="src/app/auth/api/refresh/route.ts" line_range="27" />
<code_context>
+
+ try {
+ const baseUrl = `${process.env.LS_LOGIN_URL}/oidc/token`;
+ const response = await axiosBase.post(
+ baseUrl,
+ new URLSearchParams({
</code_context>
<issue_to_address>
**Lost refresh response invalidates session**
When the identity provider rotates the token but the refresh response is lost before the browser receives its cookies, the identity provider can consume and rotate the refresh token before the route’s response reaches the browser. If the response is lost, the browser retains the now-invalid old token; its next refresh receives 401 and clears the session.
Use server-side refresh-token storage with recovery, or configure the provider to tolerate retries of a recently rotated token.
Also at `src/app/auth/api/refresh/route.ts:100-104`.
</issue_to_address>
### Comment 15
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="47" />
<code_context>
+ }
+
+ try {
+ const response = await axiosBase.get(
+ `${url.origin}${url.pathname.replace(/\/$/, "")}/service-info`,
+ {
</code_context>
<issue_to_address>
**Authenticated WES services disappear**
When a WES service requires authentication for its service-info endpoint, `probeWesService` calls `/service-info` without an access token, and 4xx responses become `invalid` probes that the route filters out. WES instances that protect service-info therefore vanish from the selector even though the browser provider can authenticate workflow requests.
Authenticate the probe with the user's token, or avoid excluding services solely because an unauthenticated service-info request returns 401 or 403.
</issue_to_address>
### Comment 16
<location path="src/app/api/workflows/get-service-info/route.ts" line_range="32" />
<code_context>
+ },
+ );
+
+ const server = servers.find((item) => item.id === id);
+
+ if (!server) {
</code_context>
<issue_to_address>
**Non-WES records pass WES lookup**
When the requested ID belongs to a non-WES registry record whose URL has a WES-shaped path, the ID lookup can return a registry record for another service type, and the handler then treats its URL as a WES endpoint if its path matches; callers receive that record’s service information instead of a WES-only result.
Filter the registry lookup to `wes` and `wes-gateway` artifacts before accepting the record.
</issue_to_address>
### Comment 17
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="57-64" />
<code_context>
+ },
+ );
+
+ const ok =
+ response.data !== null &&
+ typeof response.data === "object" &&
+ !Array.isArray(response.data);
+
+ return ok
+ ? { status: "valid", serviceInfo: response.data }
+ : {
+ status: "invalid",
+ reason: "service-info is not a JSON object",
</code_context>
<issue_to_address>
**Malformed service metadata breaks workflow pages**
When a WES service returns an object with malformed `workflow_type_versions` entries, `probeWesService` accepts any JSON object as `WESServiceInfo`, but `WESServerList` and `WorkflowValidator` dereference nested `workflow_type_version` fields without checking them. A nonconforming WES response therefore crashes the workflow selector or create page.
Validate and normalize service-info responses at the API boundary, or guard nested capability fields before rendering.
Also at `src/app/dashboard/workflows/_components/wes-server-list.tsx:166-167`, `src/app/dashboard/workflows/_components/workflow-validator.tsx:61-62`.
</issue_to_address>
### Comment 18
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="184-185" />
<code_context>
+
+ const completionTime = Date.now();
+ if (!cache || completionTime > cache.timestamp) {
+ cache = { data: servers, timestamp: completionTime };
+ }
+
+ return NextResponse.json(servers, {
</code_context>
<issue_to_address>
**Older WES data overwrites newer data**
When overlapping WES fetches observe different registry snapshots and the older probe finishes last, the cache uses completion time, so the later-completing request can replace newer data with an older snapshot; the client also applies responses unconditionally. Callers can therefore see stale server lists and health data.
Order cache updates and client state updates by request or snapshot age so older fetches cannot replace newer results.
Also at `src/app/dashboard/workflows/_components/wes-server-list.tsx:53`.
</issue_to_address>
### Comment 19
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="129" />
<code_context>
+ }
+
+ const now = Date.now();
+ if (cache && now - cache.timestamp < CACHE_TTL) {
+ const unreachableCount = cache.data.filter(
+ (s) => s.health.status === "unreachable",
</code_context>
<issue_to_address>
**Manual refresh keeps stale health**
When a user clicks Refresh before the server-side cache expires, the refresh button calls the same endpoint that serves the in-memory cache, so clicking it within the 60-second TTL returns the cached health and service information instead of probing again. Users cannot make a recovered service available through the button until the cache expires.
Add a cache-bypass option for the manual refresh path, or make the UI indicate that refresh is deferred until the cache expires.
Also at `src/app/dashboard/workflows/_components/wes-server-list.tsx:88`.
</issue_to_address>
### Comment 20
<location path="src/app/dashboard/page.tsx" line_range="2" />
<code_context>
+function DashboardPage() {
+ return <div>WIP</div>;
+}
+
</code_context>
<issue_to_address>
**Dashboard remains a placeholder**
When a user opens the app root or completes login, the dashboard page renders only `WIP`, and both the root route and successful login send users to `/dashboard`; users arriving through either entry point see a blank placeholder instead of a dashboard.
Implement the dashboard landing content or redirect users to a completed task or workflow view.
</issue_to_address>
### Comment 21
<location path="src/app/api/workflows/get-wes-servers/route.ts" line_range="194" />
<code_context>
+ },
+ });
+ } catch (err) {
+ if (axios.isAxiosError(err) || axios.isCancel(err)) {
+ return NextResponse.json(
+ { message: "Failed to fetch Cloud Registry services" },
</code_context>
<issue_to_address>
**Registry failures lack operator diagnostics**
When the registry request or server-list processing fails, the route converts registry and probe failures into generic HTTP responses without logging the caught error, so operators cannot distinguish a timeout, malformed registry response, or other failure from server logs when users report that WES instances failed to load.
Log a sanitized error category and add operational metrics for registry and probe failures while keeping the generic client response.
</issue_to_address>
### Comment 22
<location path="docs/workflow-examples.md" line_range="22" />
<code_context>
+ "cwd": "/workspace"
+ }
+ ],
+ "inputs": {}
+}
+```
</code_context>
<issue_to_address>
**TES examples fail schema validation**
When a reader submits one of the documented TES examples to a schema-validating service, when readers submit the documented TES task examples, their `inputs` object does not match the TES Task schema, which represents inputs as an array of input records. Services validating that schema reject the examples, despite the document describing them as known to run.
Rewrite the TES examples to use the TES v1 Task input-record array shape and valid fields.
Also at `docs/workflow-examples.md:45`.
</issue_to_address>
### Comment 23
<location path="README.md" line_range="91" />
<code_context>
+
+Do not commit `.env.local` or expose `OIDC_CLIENT_SECRET` to client-side code.
+
+For detailed deployment and service configuration requirements, see the [Deployment Guide](./docs/DEPLOYMENT.md).
+
+
</code_context>
<issue_to_address>
**Deployment guide link is broken**
When a reader follows the deployment guide link, the README links to `docs/DEPLOYMENT.md`, but the added file is `docs/deployment.md`. On case-sensitive filesystems and GitHub, following the link does not open the deployment guide.
Change the README link to match the added file's lowercase path, or rename the file to match the link.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 22 findings to address first, and the new WES discovery routes make server-side requests to HTTPS URLs supplied by the Cloud Registry without blocking private or internal destinations, so a malicious or compromised registry entry could make the app probe internal services. Reverting removes the probing code, but any access or data exposed by requests made before the revert cannot be recalled.
Blocking findings: src/app/api/workflows/get-service-info/route.ts:62, src/hooks/use-wes-provider.ts:17, src/app/auth/api/refresh/route.ts:67, src/app/auth/api/refresh/route.ts:27, src/app/auth/api/refresh/route.ts:136, and 17 more
| parsedUrl.protocol !== "https:" || | ||
| parsedUrl.username || | ||
| parsedUrl.password || | ||
| parsedUrl.port || | ||
| !isValidPath | ||
| ) { |
There was a problem hiding this comment.
🔴 Critical · Internal services are exposed
When a registry entry points to a private, loopback, or otherwise internal HTTPS host, the WES probe and service-info route check the URL scheme but not the destination host, so the unauthenticated routes make server-side requests to internal services and the service-info route returns their responses to callers.
Reject private, loopback, and otherwise internal destinations in both handlers before making requests.
Also at src/app/api/workflows/get-wes-servers/route.ts:42-47, src/app/api/workflows/get-service-info/route.ts:70.
Prompt for AI agents
In `src/app/api/workflows/get-service-info/route.ts` at lines 57-62:
**Internal services are exposed**
When a registry entry points to a private, loopback, or otherwise internal HTTPS host, the WES probe and service-info route check the URL scheme but not the destination host, so the unauthenticated routes make server-side requests to internal services and the service-info route returns their responses to callers.
Reject private, loopback, and otherwise internal destinations in both handlers before making requests.
Also at `src/app/api/workflows/get-wes-servers/route.ts:42-47`, `src/app/api/workflows/get-service-info/route.ts:70`.| const headers = new Headers(init.headers); | ||
| const token = await this.getToken(); | ||
|
|
||
| if (token) { |
There was a problem hiding this comment.
🟠 High · WES servers receive bearer tokens
When a user selects a registry-listed WES server controlled by an attacker, a malicious operator can list a WES server in the registry and induce a logged-in user to select it. TokenWesProvider attaches the user's access token to requests to that server, allowing its operator to capture the bearer token and use it against services that accept it.
Only forward access tokens to explicitly trusted service origins, and clearly identify the destination before authorizing token-bearing requests.
Prompt for AI agents
In `src/hooks/use-wes-provider.ts` at line 17:
**WES servers receive bearer tokens**
When a user selects a registry-listed WES server controlled by an attacker, a malicious operator can list a WES server in the registry and induce a logged-in user to select it. `TokenWesProvider` attaches the user's access token to requests to that server, allowing its operator to capture the bearer token and use it against services that accept it.
Only forward access tokens to explicitly trusted service origins, and clearly identify the destination before authorizing token-bearing requests.| httpOnly: true, | ||
| }; | ||
|
|
||
| const cookieStoreAfter = await cookies(); |
There was a problem hiding this comment.
🟠 High · Logout leaves sessions active
When a refresh request is in flight while the user logs out and the refresh response arrives last, the second cookies() read sees the refresh request's original cookies, not the marker set by the concurrent logout response. The refresh can therefore return new authentication cookies after logout, leaving the browser signed in.
Prevent an in-flight refresh from issuing usable authentication cookies after a concurrent logout.
Also at src/app/auth/api/logout/route.ts:35-47, src/app/auth/api/refresh/route.ts:68-71.
Prompt for AI agents
In `src/app/auth/api/refresh/route.ts` at line 67:
**Logout leaves sessions active**
When a refresh request is in flight while the user logs out and the refresh response arrives last, the second `cookies()` read sees the refresh request's original cookies, not the marker set by the concurrent logout response. The refresh can therefore return new authentication cookies after logout, leaving the browser signed in.
Prevent an in-flight refresh from issuing usable authentication cookies after a concurrent logout.
Also at `src/app/auth/api/logout/route.ts:35-47`, `src/app/auth/api/refresh/route.ts:68-71`.|
|
||
| try { | ||
| const baseUrl = `${process.env.LS_LOGIN_URL}/oidc/token`; | ||
| const response = await axiosBase.post( |
There was a problem hiding this comment.
🟡 Medium · Concurrent refreshes end sessions
When multiple tabs refresh together and the identity provider rotates single-use refresh tokens, both requests submit the same refresh token; after one succeeds, the other receives 401 and the refresh route deletes the token cookies. The user loses the session even though the successful request issued replacement tokens.
Coordinate refreshes across tabs or handle a losing refresh response without deleting tokens issued by the successful exchange.
Also at src/app/auth/api/refresh/route.ts:101, src/app/auth/api/refresh/route.ts:131-144, src/hooks/use-token-refresh.ts:24-25.
Prompt for AI agents
In `src/app/auth/api/refresh/route.ts` at line 27:
**Concurrent refreshes end sessions**
When multiple tabs refresh together and the identity provider rotates single-use refresh tokens, both requests submit the same refresh token; after one succeeds, the other receives 401 and the refresh route deletes the token cookies. The user loses the session even though the successful request issued replacement tokens.
Coordinate refreshes across tabs or handle a losing refresh response without deleting tokens issued by the successful exchange.
Also at `src/app/auth/api/refresh/route.ts:101`, `src/app/auth/api/refresh/route.ts:131-144`, `src/hooks/use-token-refresh.ts:24-25`.| const response = NextResponse.json( | ||
| { error: "Failed to refresh token" }, | ||
| { status: 401 }, | ||
| ); |
There was a problem hiding this comment.
🟡 Medium · Temporary outages redirect users
When the identity provider or network fails during a refresh, the refresh route returns 401 for network and upstream failures, and useTokenRefresh redirects on any failed refresh request. A temporary outage therefore sends active users to login instead of preserving the session and retrying.
Distinguish invalid refresh tokens from transient failures and redirect only for an invalid session.
Also at src/hooks/use-token-refresh.ts:46-47.
Prompt for AI agents
In `src/app/auth/api/refresh/route.ts` at lines 133-136:
**Temporary outages redirect users**
When the identity provider or network fails during a refresh, the refresh route returns 401 for network and upstream failures, and `useTokenRefresh` redirects on any failed refresh request. A temporary outage therefore sends active users to login instead of preserving the session and retrying.
Distinguish invalid refresh tokens from transient failures and redirect only for an invalid session.
Also at `src/hooks/use-token-refresh.ts:46-47`.| } | ||
|
|
||
| const now = Date.now(); | ||
| if (cache && now - cache.timestamp < CACHE_TTL) { |
There was a problem hiding this comment.
🟡 Medium · Manual refresh keeps stale health
When a user clicks Refresh before the server-side cache expires, the refresh button calls the same endpoint that serves the in-memory cache, so clicking it within the 60-second TTL returns the cached health and service information instead of probing again. Users cannot make a recovered service available through the button until the cache expires.
Add a cache-bypass option for the manual refresh path, or make the UI indicate that refresh is deferred until the cache expires.
Also at src/app/dashboard/workflows/_components/wes-server-list.tsx:88.
Prompt for AI agents
In `src/app/api/workflows/get-wes-servers/route.ts` at line 129:
**Manual refresh keeps stale health**
When a user clicks Refresh before the server-side cache expires, the refresh button calls the same endpoint that serves the in-memory cache, so clicking it within the 60-second TTL returns the cached health and service information instead of probing again. Users cannot make a recovered service available through the button until the cache expires.
Add a cache-bypass option for the manual refresh path, or make the UI indicate that refresh is deferred until the cache expires.
Also at `src/app/dashboard/workflows/_components/wes-server-list.tsx:88`.| @@ -0,0 +1,5 @@ | |||
| function DashboardPage() { | |||
| return <div>WIP</div>; | |||
There was a problem hiding this comment.
🟡 Medium · Dashboard remains a placeholder
When a user opens the app root or completes login, the dashboard page renders only WIP, and both the root route and successful login send users to /dashboard; users arriving through either entry point see a blank placeholder instead of a dashboard.
Implement the dashboard landing content or redirect users to a completed task or workflow view.
Prompt for AI agents
In `src/app/dashboard/page.tsx` at line 2:
**Dashboard remains a placeholder**
When a user opens the app root or completes login, the dashboard page renders only `WIP`, and both the root route and successful login send users to `/dashboard`; users arriving through either entry point see a blank placeholder instead of a dashboard.
Implement the dashboard landing content or redirect users to a completed task or workflow view.| }, | ||
| }); | ||
| } catch (err) { | ||
| if (axios.isAxiosError(err) || axios.isCancel(err)) { |
There was a problem hiding this comment.
⚪ Low · Registry failures lack operator diagnostics
When the registry request or server-list processing fails, the route converts registry and probe failures into generic HTTP responses without logging the caught error, so operators cannot distinguish a timeout, malformed registry response, or other failure from server logs when users report that WES instances failed to load.
Log a sanitized error category and add operational metrics for registry and probe failures while keeping the generic client response.
Prompt for AI agents
In `src/app/api/workflows/get-wes-servers/route.ts` at line 194:
**Registry failures lack operator diagnostics**
When the registry request or server-list processing fails, the route converts registry and probe failures into generic HTTP responses without logging the caught error, so operators cannot distinguish a timeout, malformed registry response, or other failure from server logs when users report that WES instances failed to load.
Log a sanitized error category and add operational metrics for registry and probe failures while keeping the generic client response.| "cwd": "/workspace" | ||
| } | ||
| ], | ||
| "inputs": {} |
There was a problem hiding this comment.
🟡 Medium · TES examples fail schema validation
When a reader submits one of the documented TES examples to a schema-validating service, when readers submit the documented TES task examples, their inputs object does not match the TES Task schema, which represents inputs as an array of input records. Services validating that schema reject the examples, despite the document describing them as known to run.
Rewrite the TES examples to use the TES v1 Task input-record array shape and valid fields.
Also at docs/workflow-examples.md:45.
Prompt for AI agents
In `docs/workflow-examples.md` at line 22:
**TES examples fail schema validation**
When a reader submits one of the documented TES examples to a schema-validating service, when readers submit the documented TES task examples, their `inputs` object does not match the TES Task schema, which represents inputs as an array of input records. Services validating that schema reject the examples, despite the document describing them as known to run.
Rewrite the TES examples to use the TES v1 Task input-record array shape and valid fields.
Also at `docs/workflow-examples.md:45`.|
|
||
| Do not commit `.env.local` or expose `OIDC_CLIENT_SECRET` to client-side code. | ||
|
|
||
| For detailed deployment and service configuration requirements, see the [Deployment Guide](./docs/DEPLOYMENT.md). |
There was a problem hiding this comment.
🟡 Medium · Deployment guide link is broken
When a reader follows the deployment guide link, the README links to docs/DEPLOYMENT.md, but the added file is docs/deployment.md. On case-sensitive filesystems and GitHub, following the link does not open the deployment guide.
Change the README link to match the added file's lowercase path, or rename the file to match the link.
Prompt for AI agents
In `README.md` at line 91:
**Deployment guide link is broken**
When a reader follows the deployment guide link, the README links to `docs/DEPLOYMENT.md`, but the added file is `docs/deployment.md`. On case-sensitive filesystems and GitHub, following the link does not open the deployment guide.
Change the README link to match the added file's lowercase path, or rename the file to match the link.
Closing issues
Closes #42
Closes #40
Summary by Sourcery
Rebuild Krini as an authenticated Next.js dashboard for discovering and running TES tasks and WES workflows.
New Features:
Enhancements:
Build:
CI:
Deployment:
Documentation:
Chores: