Skip to content

Fix WordPress reply relationships during migration#70

Merged
ruibaby merged 1 commit into
mainfrom
fix/wordpress-reply-import-order
Jul 14, 2026
Merged

Fix WordPress reply relationships during migration#70
ruibaby merged 1 commit into
mainfrom
fix/wordpress-reply-import-order

Conversation

@ruibaby

@ruibaby ruibaby commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

  • avoid assigning a root Comment name to quoteReply for direct WordPress replies
  • declare parent Comment and quoted Reply dependencies for reply migration tasks
  • execute dependent tasks in order while preserving concurrency between independent and sibling tasks
  • block child tasks when a parent fails and retry failed dependency chains in the correct order
  • preserve orphaned and cyclic WordPress comments without generating invalid reply references

Reproduction

Before this change:

  1. Parse a WordPress WXR export containing a root comment and replies.
  2. A direct reply receives the root Comment name in both commentName and quoteReply.
  3. Migration tasks are submitted to the concurrent queue without dependency ordering, allowing a Reply task to start before its parent Comment task completes.

After this change, direct replies only reference their root Comment, nested replies quote an actual Reply, and migration tasks wait for their declared parents.

Testing

  • corepack pnpm --dir ui type-check
  • corepack pnpm --dir ui test:unit
  • corepack pnpm --dir ui exec eslint src/composables/use-migrate-task-runner.ts src/composables/use-migrate-task.ts src/modules/wordpress/use-wordpress-data-parser.ts src/types/index.ts tests/wordpress-data-parser.test.ts tests/use-migrate-task.test.ts tests/use-migrate-task-runner.test.ts
  • ./gradlew check
  • ./gradlew build
  • validated against the reported WXR sample containing 5,513 comment records and 2,355 replies from the exported WordPress user

@ruibaby
ruibaby merged commit 9723a0d into main Jul 14, 2026
1 check passed
@ruibaby
ruibaby deleted the fix/wordpress-reply-import-order branch July 14, 2026 07:46
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.

1 participant