Patch: variable count display#3040
Conversation
Greptile SummaryThis patch introduces a
Confidence Score: 3/5The display-count fix is correct, but the updated early-return guard in The src/routes/(console)/project-[region]-[project]/updateVariables.svelte — specifically the Important Files Changed
Reviews (1): Last reviewed commit: "fix lint" | Re-trigger Greptile |
| async function ensureAllVariablesLoaded() { | ||
| if (fullVariableList && fullVariableList.total === variableList.total) return; | ||
| if ( | ||
| fullVariableList && | ||
| fullVariableList.variables.length >= variableList.variables.length | ||
| ) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
When
backendPagination is true the raw editor and import modal both call ensureAllVariablesLoaded, which must load every variable regardless of the current page. The new guard fullVariableList.variables.length >= variableList.variables.length compares against the current page size (e.g. 10), not the server total. A stale fullVariableList with, say, 50 of 100 variables would satisfy 50 >= 10 and return early, leaving the editor with incomplete data. Comparing against variableList.total (the server total) correctly gates on whether all variables are present.
| async function ensureAllVariablesLoaded() { | |
| if (fullVariableList && fullVariableList.total === variableList.total) return; | |
| if ( | |
| fullVariableList && | |
| fullVariableList.variables.length >= variableList.variables.length | |
| ) { | |
| return; | |
| } | |
| async function ensureAllVariablesLoaded() { | |
| if ( | |
| fullVariableList && | |
| fullVariableList.variables.length >= variableList.total | |
| ) { | |
| return; | |
| } |
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.)