fix(console): stop related row request loop and correct load order#2962
fix(console): stop related row request loop and correct load order#2962HarshMN2345 merged 1 commit intomainfrom
Conversation
Greptile SummaryThis PR fixes two bugs in the related-row editing side sheet for the tablesDB feature: a request loop caused by a reactive Key changes:
Confidence Score: 5/5Safe to merge — all three changes are targeted, correct fixes with no regressions. The PR fixes two real bugs (request loop and wrong load order) with straightforward, well-scoped changes. The {#if} guard + onMount pattern is the idiomatic way to scope side-effects to mount lifetime in Svelte 5, replacing the loop-prone $effect. The load order fix (schema before row fetch) is clearly correct. The new RelatedRowColumns component is a clean extraction with no logic changes. No P0 or P1 findings remain. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/+layout.svelte | Adds an {#if} guard around EditRelatedRow so it only mounts when the sheet is open with valid props — correctly prevents stale mounts and stops the onMount/load cycle from firing with empty data. |
| src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/editRelated.svelte | Replaces loop-causing $effect with onMount, fixes schema-before-row load order, and switches from snapshot getStore() to live Writable via workData.get() for correct form reactivity. |
| src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/rows/relatedRowColumns.svelte | New presentational component encapsulating column rendering; correctly uses $workStore subscription for reactivity and accepts a gap prop for layout flexibility. |
Reviews (1): Last reviewed commit: "fix(console): stop related row request l..." | Re-trigger Greptile
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)