Skip to content

Prevent syncing from incomplete source node#5761

Open
bjester wants to merge 1 commit intolearningequality:hotfixesfrom
bjester:incomplete-sync
Open

Prevent syncing from incomplete source node#5761
bjester wants to merge 1 commit intolearningequality:hotfixesfrom
bjester:incomplete-sync

Conversation

@bjester
Copy link
Member

@bjester bjester commented Mar 16, 2026

Summary

Adds check to our sync_node logic, which synchronizes metadata and content of imported nodes with their sources, to ensure the source is complete. Otherwise, it logs a warning.

References

fixes #5683
related: #5760

Reviewer guidance

Follow the reproduce steps in the issue

AI usage

None

@bjester bjester marked this pull request as ready for review March 17, 2026 22:19
@bjester bjester requested a review from rtibblesbot March 17, 2026 22:19
Copy link
Contributor

@rtibblesbot rtibblesbot left a comment

Choose a reason for hiding this comment

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

Clean, focused fix that prevents syncing from an incomplete source node, directly addressing the P0 bug.

CI passing. PR targets hotfixes (not the default unstable branch), which is appropriate for a P0 regression fix. No new user-facing strings added.

  • suggestion: The warning log could be more informative (see inline comment)
  • suggestion: Test could add an explicit refresh_from_db to strengthen the assertion (see inline comment)
  • praise: Good test structure and necessary fix to _create_video_node to ensure the completeness guard works correctly across all existing tests

@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?

Reviewed the pull request diff checking for:

  • Correctness: bugs, edge cases, undocumented behavior, resource leaks, hardcoded values
  • Design: unnecessary complexity, naming, readability, comment accuracy, redundant state
  • Architecture: duplicated concerns, minimal interfaces, composition over inheritance
  • Testing: behavior-based assertions, mocks only at hard boundaries, accurate coverage
  • Completeness: missing dependencies, unupdated usages, i18n, accessibility, security
  • Principles: DRY (same reason to change), SRP, Rule of Three (no premature abstraction)
  • Checked CI status and linked issue acceptance criteria
  • For UI changes: inspected screenshots for layout, visual completeness, and consistency

Copy link
Contributor

@rtibblesbot rtibblesbot left a comment

Choose a reason for hiding this comment

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

Clean fix that addresses the P0 regression. The completeness guard is correctly placed, the warning log is informative, and the test setup changes ensure existing tests exercise the intended sync path.

CI passing. PR targets hotfixes, appropriate for a P0 fix. No new user-facing strings.

Delta from prior review:

  • RESOLVED: Warning log now includes both node.pk and original_node.pk as suggested

  • ACKNOWLEDGED: refresh_from_db suggestion was minor and reasonably declined

  • praise: Solid, minimal fix — the guard returns early without mutating the cloned node, which is exactly the right behavior for this case


@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly

How was this generated?

Compared the current PR state against findings from a prior review:

  • Retrieved prior bot reviews deterministically via the GitHub API
  • Classified each prior finding as RESOLVED, UNADDRESSED, ACKNOWLEDGED, or CONTESTED
  • Only raised NEW findings for newly introduced code
  • Reviewed the pull request diff checking for correctness, design, architecture, testing, completeness, and adherence to DRY/SRP principles
  • Checked CI status and linked issue acceptance criteria


self.assertIsNotNone(cloned_video.license_id)
cloned_video.mark_complete()
self.assertTrue(cloned_video.complete)
Copy link
Contributor

Choose a reason for hiding this comment

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

praise: Good test structure — making the original incomplete via license_id = None, then verifying the cloned node's license_id and complete status are preserved. This directly validates the guard's purpose.

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.

2 participants