fix(console): show schedule name instead of ID after creation#283
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.tsxdisplays each row's name by resolving itsscheduled_idthrough aschemaMap(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 — soschemaMaphad no entry for the newscheduled_id, and the row fell back to rendering the raw UUID:Fix
Capture the schema resolver's reload function and refresh it alongside the instance list after a successful create:
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 = idanti-pattern. None reproduce it — they all reload from the server and render server-providednamefields (the?? .idoccurrences 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 --noEmitpasses clean.