Skip to content

fix(communications): load templates client-side with graceful API failures - #301

Merged
kkopanidis merged 2 commits into
ui-rewritefrom
fix/communications-templates-prod-error
Aug 3, 2026
Merged

fix(communications): load templates client-side with graceful API failures#301
kkopanidis merged 2 commits into
ui-rewritefrom
fix/communications-templates-prod-error

Conversation

@CluelessBiker

@CluelessBiker CluelessBiker commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • Moves email and unified template fetching off the server render path for /communications/test and /communications/templates.
  • Shows inline loading and error states when GET /email/templates fails, instead of crashing into the redacted Module Error boundary.
  • Adds degraded-mode UI when the unified templates API is unavailable, and preserves session-timeout redirects in communications server actions.
  • Preserves models list filter/pagination state when navigating into and back from a model detail view (owner, page, search).

Why

On experimental.dev, both pages failed during server-side getTemplates() while other communications routes worked. The same UI works locally, so the failure is environment-specific. Client-side fetching surfaces actionable errors in production and keeps SMS, push, and email-only flows usable when template APIs are down.

Separately, the models list already stored filters in the URL, but navigating into a model detail and clicking Models always returned to the unfiltered list. List state is now carried via a list query param on the detail URL and restored on back navigation.

Related PR

Test plan

  • Open /communications/test and /communications/templates on localhost — both load normally.
  • Stop the Conduit API and reload — pages show inline template errors, not Module Error.
  • Confirm unified-only actions are hidden when the unified API is unavailable.
  • Go to /database/models?owner=database&page=2, open a model, then click Models — returns to the filtered, paginated list.
  • Switch models via the model switcher on detail — list param persists; back still restores the original list state.
  • Switch detail tabs (Schema / Data / Settings) — list param remains in the URL.

kkopanidis
kkopanidis previously approved these changes Jul 31, 2026
…lures

Move email and unified template fetching off the server render path so
GET /email/templates failures on remote environments show inline errors
instead of a redacted Module Error boundary crash.
Carry list filter/pagination state via a `list` query param on model detail
URLs so the in-app back button restores owner, page, and search filters.
@CluelessBiker
CluelessBiker force-pushed the fix/communications-templates-prod-error branch from d7545b5 to 31913be Compare August 3, 2026 05:11
@kkopanidis
kkopanidis merged commit c3da400 into ui-rewrite Aug 3, 2026
3 checks passed
@kkopanidis
kkopanidis deleted the fix/communications-templates-prod-error branch August 3, 2026 07:44
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.

2 participants