Fix text migration failure caused by outdated inputs_count#4222
Fix text migration failure caused by outdated inputs_count#4222Sanketjadhav31 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request synchronizes the inputs_count variable to 13 in document_migration.rs to ensure subsequent Text migrations function correctly. The reviewer suggested removing the hardcoded line number reference from the added comment to prevent it from becoming outdated as the code changes.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| // Keep inputs_count synchronized because subsequent Text migrations depend on it (see line 1692) | ||
| inputs_count = 13; |
There was a problem hiding this comment.
Avoid hardcoding specific line numbers in comments (such as (see line 1692)). As the codebase evolves and other migrations or imports are added or removed, these line numbers will quickly become outdated and misleading. It is better to refer to the target migration conceptually.
| // Keep inputs_count synchronized because subsequent Text migrations depend on it (see line 1692) | |
| inputs_count = 13; | |
| // Keep inputs_count synchronized because subsequent Text migrations depend on it | |
| inputs_count = 13; |
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 5/5
- In
editor/src/messages/portfolio/document_migration.rs, the hardcoded "see line 1692" comment can drift as migrations change, which could mislead future maintainers and cause migration updates to target the wrong dependency—replace the line-number reference with a conceptual pointer to the dependent migration before merging.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Applied reviewer suggestion for a more robust reference to the dependent Text migration. Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Fixes #4212
I found a problem, with text migration. When we upgrade nodes from 11 inputs to 13 inputs two new inputs are added. The inputs_count variable is not updated.
Later another text migration checks if inputs_count is 13. Since the value is not updated this migration is skipped when we import text documents.
This change makes sure inputs_count is updated after migration. So the next text migration can work correctly.