Skip to content

Revert SSR to disabled and fix PO status update parsing#343

Merged
brucetony merged 4 commits intodevelopfrom
342-fix-redirect-error-on-log-page-load
Mar 10, 2026
Merged

Revert SSR to disabled and fix PO status update parsing#343
brucetony merged 4 commits intodevelopfrom
342-fix-redirect-error-on-log-page-load

Conversation

@brucetony
Copy link
Collaborator

@brucetony brucetony commented Mar 10, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Enhanced analysis status and progress data synchronization to use pod-provided information more reliably
  • Infrastructure Changes

    • Updated server-side rendering configuration
    • Modified server-side authentication handling setup

@brucetony brucetony linked an issue Mar 10, 2026 that may be closed by this pull request
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

📝 Walkthrough

Walkthrough

This PR refactors analysis status handling to prioritize PodOrc pod status data over hub-provided statuses, renames the analysis update event from updateAnalysisRun to updateAnalysisRunStatus, improves type safety in authentication token handling, disables server-side rendering, and enables server-side authentication in the Nuxt configuration.

Changes

Cohort / File(s) Summary
Analysis Status Handling
app/components/analysis/AnalysesTable.vue
Modified parseAnalysis logic to trust PodOrc pod status objects when available. Now uses an acceptableHubStatuses set (Failed, Executed, Finished) and prioritizes podStatus.status and podStatus.progress over hub data. Sets execution_status to null when hub statuses are not acceptable or pod data is missing.
Analysis Update Events
app/components/analysis/AnalysisControlButtons.vue, app/components/analysis/AnalysisUpdateButton.vue
Renamed emitted event from updateAnalysisRun to updateAnalysisRunStatus. Updated AnalysisUpdateButton to emit both status and progress values in the payload instead of a single status placeholder.
Test Updates
test/components/analysis/AnalysisUpdateButton.spec.ts, test/mockapi/handlers.ts
Updated test expectations to reflect the event rename and handler responses to return PodStatus objects with status and progress fields instead of string statuses.
Nuxt Configuration
nuxt.config.ts
Changed ssr from conditional process.env.NODE_ENV !== "development" to hard-coded false, disabling server-side rendering. Changed auth.disableServerSideAuth from true to false, enabling server-side authentication.
Authentication Type Safety
server/routes/flame/api/auth/[...]
Added JWT type import from next-auth/jwt. Changed refreshAccessToken parameter type from any to JWT. Cast token.refresh_token to string in refresh request for type safety.

Possibly related PRs

  • Analysis buttons update on status refresh #313: Modifies AnalysisUpdateButton and AnalysisControlButtons event bindings for status updates with similar event/emit refactoring patterns.
  • Refactor for Hub v0.8.27+ #330: Updates the same analysis components (AnalysesTable, AnalysisControlButtons/AnalysisUpdateButton) to migrate status handling logic and incorporate PodStatus data.
  • SSR restored #340: Directly modifies the same nuxt.config.ts properties (ssr and auth.disableServerSideAuth) with identical configuration changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit hops through status flows,
Pod and hub in steady rows,
Events renamed, progress shines,
Auth types tighten up the lines,
SSR bows out with a cheer! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: reverting SSR to disabled and fixing PO status update parsing, which directly correspond to the nuxt.config.ts and analysis component changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 342-fix-redirect-error-on-log-page-load

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
{"name":"HttpError","status":500,"request":{"method":"PATCH","url":"https://api.github.com/repos/PrivateAIM/node-ui/issues/comments/4030704748","headers":{"accept":"application/vnd.github.v3+json","user-agent":"octokit.js/0.0.0-development octokit-core.js/7.0.6 Node.js/24","authorization":"token [REDACTED]","content-type":"application/json; charset=utf-8"},"body":{"body":"<!-- This is an auto-generated comment: summarize by coderabbit.ai -->\n<!-- walkthrough_start -->\n\n<details>\n<summary>📝 Walkthrough</summary>\n\n## Walkthrough\n\nUpdates analysis status handling to use PodStatus enum instead of string literals, renames the updateAnalysisRun event to updateAnalysisRunStatus with modified payload structure, changes token expiry calculations from milliseconds to seconds, and modifies Nuxt SSR and authentication configuration.\n\n## Changes\n\n|Cohort / File(s)|Summary|\n|---|---|\n|**Analysis Status Enum Migration** <br> `app/components/analysis/AnalysesTable.vue`, `test/mockapi/handlers.ts`|Replaced hardcoded status strings (\"running\", \"finished\") with PodStatus enum members; introduced acceptableHubStatuses set to handle deprecated statuses; updated mock API to return structured status objects with PodStatus and progress fields.|\n|**Analysis Update Event Refactoring** <br> `app/components/analysis/AnalysisUpdateButton.vue`, `app/components/analysis/AnalysisControlButtons.vue`, `test/components/analysis/AnalysisUpdateButton.spec.ts`|Renamed emitted event from \"updateAnalysisRun\" to \"updateAnalysisRunStatus\"; changed payload from (updatedStatus, undefined) to (updatedStatus.status, updatedStatus.progress); updated test assertions to match new event name and payload structure.|\n|**Nuxt Configuration** <br> `nuxt.config.ts`|Changed ssr from conditional (process.env.NODE\\_ENV !== \"development\") to hardcoded false; flipped auth.disableServerSideAuth from true to false.|\n|**Authentication Handler** <br> `server/routes/flame/api/auth/[...].ts`|Converted token expiry calculations from milliseconds-based (Date.now() + expires\\_in \\\\* 1000) to seconds-based (floor(Date.now()/1000) + expires\\_in) format; updated freshness validation to align with seconds-based expiry.|\n\n## Estimated code review effort\n\n🎯 3 (Moderate) | ⏱️ ~22 minutes\n\n## Possibly related PRs\n\n- **PrivateAIM/node-ui#330**: Modifies the same analysis status code paths with PodStatus enum values and renames updateAnalysisRun event across multiple files.\n- **PrivateAIM/node-ui#313**: Updates event bindings in AnalysisControlButtons.vue for status update handling.\n- **PrivateAIM/node-ui#340**: Changes the same nuxt.config.ts properties (ssr and auth.disableServerSideAuth).\n\n## Poem\n\n> 🐰 A button click sends status fresh and new,\n> With enums gleaming in a vibrant hue!\n> SSR takes a rest, auth stands tall,\n> Token seconds sing—no milliseconds at all! 🎵\n\n</details>\n\n<!-- walkthrough_end -->\n\n\n<!-- pre_merge_checks_walkthrough_start -->\n\n<details>\n<summary>🚥 Pre-merge checks | ✅ 2 | ❌ 1</summary>\n\n### ❌ Failed checks (1 warning)\n\n|     Check name     | Status     | Explanation                                                                          | Resolution                                                                         |\n| :----------------: | :--------- | :----------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |\n| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |\n\n<details>\n<summary>✅ Passed checks (2 passed)</summary>\n\n|     Check name    | Status   | Explanation                                                                                                                                                           |\n| :---------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled.                                                                                                           |\n|    Title check    | ✅ Passed | The title accurately reflects the two main changes: reverting SSR to disabled and fixing PO status update parsing across multiple components and configuration files. |\n\n</details>\n\n<sub>✏️ Tip: You can configure your own custom pre-merge checks in the settings.</sub>\n\n</details>\n\n<!-- pre_merge_checks_walkthrough_end -->\n\n<!-- finishing_touch_checkbox_start -->\n\n<details>\n<summary>✨ Finishing Touches</summary>\n\n- [ ] <!-- {\"checkboxId\": \"7962f53c-55bc-4827-bfbf-6a18da830691\"} --> 📝 Generate docstrings (stacked PR)\n- [ ] <!-- {\"checkboxId\": \"3e1879ae-f29b-4d0d-8e06-d12b7ba33d98\"} --> 📝 Generate docstrings (commit on current branch)\n<details>\n<summary>🧪 Generate unit tests (beta)</summary>\n\n- [ ] <!-- {\"checkboxId\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Create PR with unit tests\n- [ ] <!-- {\"checkboxId\": \"07f1e7d6-8a8e-4e23-9900-8731c2c87f58\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Post copyable unit tests in a comment\n- [ ] <!-- {\"checkboxId\": \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\", \"radioGroupId\": \"utg-output-choice-group-unknown_comment_id\"} -->   Commit unit tests in branch `342-fix-redirect-error-on-log-page-load`\n\n</details>\n\n</details>\n\n<!-- finishing_touch_checkbox_end -->\n\n<!-- announcements_start -->\n\n> [!TIP]\n> Try [Coding Plans](https://www.coderabbit.ai/issue-planner). Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).\n> Share your feedback on [Discord](https://discord.com/invite/coderabbit).\n\n<!-- announcements_end -->\n\n<!-- tips_start -->\n\n---\n\nThanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=PrivateAIM/node-ui&utm_content=343)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.\n\n<details>\n<summary>❤️ Share</summary>\n\n- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)\n- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)\n- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)\n- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)\n\n</details>\n\n<sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub>\n\n<!-- tips_end -->\n\n<!-- internal state start -->\n\n\n<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEejqANiS4AlElIq5IAZWc3IBSLSQqr9TPQAZvAAHpAACgDykIi41NjI2Ny01CQ8aBSI8BhEBgBy2MwClFwAzAAspQYAqjYAMlywuLjciBwA9O1E6rDYAhpMzO3hFJKpAIIAkgCy7RiKJGDY8O3c2BYW7RVV1YglkAIU2AwkBBiyBs742BQnB1QYDLBl5QBMYMEhYBR08D9iYEoFHwFDA+AwYAs+CIYG4aFIkPwaFoBmgGVITkOmCeXCUUih3EucVwCS4+G4ZAMdgk8BIAHdKG1IAY6ioSBYmQYAMI/VL+TiQV4ABleADYwELSmAAIxC6DS6UcV4ATg4AFYAOwALSM+mM4CgZHo+ECOAIxDIyho9EGbAwAt4/GEonEUhk8iYSioqnUWh0epMUDgqFQmDNhFI5Co1oUrHYXCodJihWYGXkcgUXpUak02l0YEM+tMBjQ3G47UG3HB7EQ7UwaAssiytfGGAbTekaIEVg0Emw1gMACJhwYAMSjyBTC1RvnJ1hp/imp6YUiIXWQOzcCxoE70H4kihYCQN/vIbKQBIkLksZjg1k5bDwtKBYHMSAWdTKCwxXCjHLIAAKQcjgwDBsiIQd2kHYIwMQWA6EHABKDx8AUCgfkQKsMG8HIIkUZxiQSSAyEKSA2CKRlIAA8J8MIxANBsb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WQuEO4wIfiZE6w4gW4hccqoKONmUuG+G6N0a6W9ER1MNJ1Cw51l14EUtklwEUueGjmPwTlGFx1d13QA8T1TVQNKNZFX111v1N1/1+t42HluFkA+FygpAitPVfVqV0NStw1CN4IzVil3MCgBFOyyAQoGgBuAApJvAgE8OxjdNgAbAtLSPaMUtpD8AAI7LCfpaQYSwBJEJrIDAYB3B2HXg3jYYRJE1Qe1A1GWfjOkMC4U1INpN4yVea+Js1kzwRvieBqbiCICbTHxMC+1p0t6Z353HWnWA3jYXWHgK0F23WjA62PV+UNUW3YVV1KX/ghy8WaWmoU4FWxAAUg15Uii0AMClAH1vD2Qai0ACAaiBAaijmlATlCjAa0BCjSjTTn2BDKhjloBn2lCGmf2X2zkkDP0MCAMahqi3wajv1ChoDlAhyaX1m8k/CPmUAvn1Xnm3kBg5l2b4BEJwiXidnEgkB4MZBfl1kGA/GDjbjb2KZZ7jC4DUhwZ0BgWwLXhMS4DQVCiwN9mYPYNUMEN9IENoMFhAA -->\n\n<!-- internal state end -->"},"request":{"retryCount":3,"retries":3,"retryAfter":16}}}

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/components/analysis/AnalysesTable.vue`:
- Around line 138-152: The helper useCommonLanguage (and PodStatus enum mapping)
is unused; either remove the dead function or apply it where analysis statuses
are normalized before rendering or comparisons. Locate where statuses are read
for the table (e.g., the status cell renderer, the column definition or any
compute/display function in AnalysesTable.vue that uses PodStatus or reads
hub-sourced status values) and call useCommonLanguage(status) (or replace direct
uses of PodStatus.Executing/Executed with the mapped values) so the
"running"/"finished" vocabulary is actually returned for hub statuses; if you
opt to remove it, delete useCommonLanguage and any unused PodStatus synonyms to
avoid dead code.
- Around line 242-246: The code only copies
executionStatuses[analysisId]!.status into analysisEntry.execution_status when a
PO status exists, so any newer progress from the PO
(executionStatuses[analysisId]!.progress) is ignored and the progress bar
remains stale; update the same branch that checks `if (executionStatuses &&
analysisId in executionStatuses)` to also copy
`executionStatuses[analysisId]!.progress` into
`analysisEntry.execution_progress` (or set it to null/undefined if not present),
and ensure you still apply the existing fallback using `acceptableHubStatuses`
for execution_status in the else branch; locate and update the block that
references `executionStatuses`, `analysisEntry.execution_status`,
`analysisEntry.execution_progress`, and `acceptableHubStatuses`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4da217ad-f065-4985-8309-6eca6f8e7e05

📥 Commits

Reviewing files that changed from the base of the PR and between edf1f0f and 6ad8567.

📒 Files selected for processing (7)
  • app/components/analysis/AnalysesTable.vue
  • app/components/analysis/AnalysisControlButtons.vue
  • app/components/analysis/AnalysisUpdateButton.vue
  • nuxt.config.ts
  • server/routes/flame/api/auth/[...].ts
  • test/components/analysis/AnalysisUpdateButton.spec.ts
  • test/mockapi/handlers.ts

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
server/routes/flame/api/auth/[...].ts (1)

108-139: ⚠️ Potential issue | 🟠 Major

Normalize expires_at units before the JWT expiry check.

The refresh path at line 137 writes expires_at in milliseconds, but the initial login at line 189 stores account.expires_at from the OAuth provider in seconds (per RFC 6749 and OpenID Connect). The guard at line 193 compares Date.now() (milliseconds) with token.expires_at, causing freshly issued tokens to be immediately treated as expired. This triggers an unnecessary refresh on every session bootstrap and breaks authentication if the refresh endpoint is unavailable.

Fix: Store expires_at in seconds consistently. Update line 137 to expires_at: Math.floor(Date.now() / 1000) + refreshedTokens.expires_in and update the guard at line 193 to Math.floor(Date.now() / 1000) < (token.expires_at as number).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@server/routes/flame/api/auth/`[...].ts around lines 108 - 139, The
refreshAccessToken function writes expires_at in milliseconds while the initial
login stores account.expires_at in seconds, causing the expiry check to misfire;
update the return in refreshAccessToken (function refreshAccessToken) to set
expires_at to seconds by using Math.floor(Date.now()/1000) +
refreshedTokens.expires_in, and change the JWT expiry guard that compares
Date.now() with token.expires_at to compare Math.floor(Date.now()/1000) <
(token.expires_at as number) so both sides use seconds consistently.
🧹 Nitpick comments (1)
nuxt.config.ts (1)

7-7: Keep the auth mode aligned with ssr: false.

app/plugins/api.ts still gets and refreshes sessions entirely from the client, so disableServerSideAuth: false does not restore real server-side route protection in the current SPA setup. Keeping those flags split makes the auth model harder to reason about and will silently change behavior the next time SSR is turned back on.

Also applies to: 29-35

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nuxt.config.ts` at line 7, The project is configured as an SPA (ssr: false)
but auth is still set up for server-side auth; update the auth mode to match by
setting disableServerSideAuth to true in the Nuxt config (ensure the same
auth-related option that is currently false is flipped), and audit
app/plugins/api.ts (which currently fetches and refreshes sessions entirely from
the client) to ensure it remains client-only session handling; this keeps the
auth model consistent and prevents silent behavior changes when SSR is toggled.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/components/analysis/AnalysesTable.vue`:
- Around line 237-246: When executionStatuses contains an entry for analysisId,
don't preserve a stale hub progress value when podStatus.progress is
null/undefined; instead set analysisEntry.execution_progress to
podStatus.progress if present, otherwise clear it (e.g. set to null or
undefined) so PO becomes the source of truth. Update the block that reads
executionStatuses[analysisId] (using variables podStatus, analysisEntry,
execution_progress, acceptableHubStatuses) to explicitly assign a cleared value
when podStatus.progress is missing rather than using "??
analysisEntry.execution_progress".

---

Outside diff comments:
In `@server/routes/flame/api/auth/`[...].ts:
- Around line 108-139: The refreshAccessToken function writes expires_at in
milliseconds while the initial login stores account.expires_at in seconds,
causing the expiry check to misfire; update the return in refreshAccessToken
(function refreshAccessToken) to set expires_at to seconds by using
Math.floor(Date.now()/1000) + refreshedTokens.expires_in, and change the JWT
expiry guard that compares Date.now() with token.expires_at to compare
Math.floor(Date.now()/1000) < (token.expires_at as number) so both sides use
seconds consistently.

---

Nitpick comments:
In `@nuxt.config.ts`:
- Line 7: The project is configured as an SPA (ssr: false) but auth is still set
up for server-side auth; update the auth mode to match by setting
disableServerSideAuth to true in the Nuxt config (ensure the same auth-related
option that is currently false is flipped), and audit app/plugins/api.ts (which
currently fetches and refreshes sessions entirely from the client) to ensure it
remains client-only session handling; this keeps the auth model consistent and
prevents silent behavior changes when SSR is toggled.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c9a366e0-27cf-4e7b-933e-b74457f1ceae

📥 Commits

Reviewing files that changed from the base of the PR and between edf1f0f and e725f17.

📒 Files selected for processing (7)
  • app/components/analysis/AnalysesTable.vue
  • app/components/analysis/AnalysisControlButtons.vue
  • app/components/analysis/AnalysisUpdateButton.vue
  • nuxt.config.ts
  • server/routes/flame/api/auth/[...].ts
  • test/components/analysis/AnalysisUpdateButton.spec.ts
  • test/mockapi/handlers.ts

@brucetony brucetony merged commit 7afb192 into develop Mar 10, 2026
5 checks passed
@brucetony brucetony deleted the 342-fix-redirect-error-on-log-page-load branch March 10, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix redirect error on log page load

1 participant