Skip to content

Fix text migration failure caused by outdated inputs_count#4222

Open
Sanketjadhav31 wants to merge 2 commits into
GraphiteEditor:masterfrom
Sanketjadhav31:fix-text-migration-inputs-count
Open

Fix text migration failure caused by outdated inputs_count#4222
Sanketjadhav31 wants to merge 2 commits into
GraphiteEditor:masterfrom
Sanketjadhav31:fix-text-migration-inputs-count

Conversation

@Sanketjadhav31

@Sanketjadhav31 Sanketjadhav31 commented Jun 10, 2026

Copy link
Copy Markdown

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +1578 to +1579
// Keep inputs_count synchronized because subsequent Text migrations depend on it (see line 1692)
inputs_count = 13;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
// 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;

@Sanketjadhav31 Sanketjadhav31 marked this pull request as ready for review June 10, 2026 19:59

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread editor/src/messages/portfolio/document_migration.rs Outdated
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>
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.

Text migration fail from Jan 16 2026

1 participant