Skip to content

fix(console): show schedule name instead of ID after creation#283

Merged
jeroenrinzema merged 1 commit into
mainfrom
fix/console-schedule-name-shows-id
Jun 30, 2026
Merged

fix(console): show schedule name instead of ID after creation#283
jeroenrinzema merged 1 commit into
mainfrom
fix/console-schedule-name-shows-id

Conversation

@jeroenrinzema

Copy link
Copy Markdown
Contributor

Problem

When creating a schedule on a user/organization detail page in the console, the newly created row showed the schedule's ID (a UUID) instead of the name the user just entered.

Root cause

scheduled-detail-table.tsx displays each row's name by resolving its scheduled_id through a schemaMap (id → name) built from /scheduled/schema. That schema list is fetched once on mount and never refreshed.

Creating a schedule with a brand-new name registers a new schema row (new id) server-side. After create, only the instance list was reloaded (reloadScheduled()) — not the schema list — so schemaMap had no entry for the new scheduled_id, and the row fell back to rendering the raw UUID:

const name = schemaMap.get(item.scheduled_id) ?? item.scheduled_id // ← UUID fallback

Fix

Capture the schema resolver's reload function and refresh it alongside the instance list after a successful create:

const [schemasResult, , reloadSchemas] = useResolver(/* … */)
// …
await Promise.all([reloadScheduled(), reloadSchemas()])

The new id→name mapping is now available immediately, so the row shows the entered name.

Scope check

I swept the other entity-creation flows (campaigns, journeys, lists, users, organizations, broadcasts) for the same name = id anti-pattern. None reproduce it — they all reload from the server and render server-provided name fields (the ?? .id occurrences elsewhere are only color-hash seeds or legitimate identity fallbacks). The bug is isolated to the scheduled table, which is the only place that resolves a display name through a separately-cached map.

Testing

  • tsc --noEmit passes clean.

When a scheduled item is created with a brand-new schedule name, the
server registers a new schedule schema (new id). The id→name map backing
the list, however, was fetched once on mount and never refreshed, so the
freshly created row had no name entry and fell back to rendering its raw
scheduled_id (a UUID) instead of the name the user just entered.

Capture the schema resolver's reload function and call it alongside the
instance reload after a successful create, so the new id→name mapping is
available immediately.
@jeroenrinzema jeroenrinzema merged commit eea493a into main Jun 30, 2026
6 checks passed
@jeroenrinzema jeroenrinzema deleted the fix/console-schedule-name-shows-id branch June 30, 2026 11:16
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.

1 participant