Skip to content

fix: sync registrations too with attendance#3

Merged
NagariaHussain merged 5 commits into
BuildWithHussain:mainfrom
vishwajeet-13:fix/sync-attendance
Dec 26, 2025
Merged

fix: sync registrations too with attendance#3
NagariaHussain merged 5 commits into
BuildWithHussain:mainfrom
vishwajeet-13:fix/sync-attendance

Conversation

@vishwajeet-13
Copy link
Copy Markdown
Contributor

@vishwajeet-13 vishwajeet-13 commented Dec 11, 2025

Sync registration before syncing attendance

Screen.Recording.2025-12-12.at.1.22.11.AM.mov

Summary by CodeRabbit

  • Improvements

    • Attendance synchronization now automatically syncs registrations from Zoom first, ensuring complete and up-to-date data during the sync process.
  • Style

    • Internal code formatting improvements for better readability.

✏️ Tip: You can customize this high-level summary in your review settings.

@vishwajeet-13
Copy link
Copy Markdown
Contributor Author

@NagariaHussain

@NagariaHussain
Copy link
Copy Markdown
Contributor

The registrant sync call should be in the backend sync registration API itself.

@vishwajeet-13
Copy link
Copy Markdown
Contributor Author

Done @NagariaHussain

@NagariaHussain
Copy link
Copy Markdown
Contributor

Don't need the publish progress

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 18, 2025

Walkthrough

Three files are updated: a guard condition is reformatted for readability, a registration synchronization pre-step is added to the attendance sync workflow, and import statements are reformatted within a type-checking block. No behavioral changes occur outside the new sync call.

Changes

Cohort / File(s) Summary
Formatting Updates
zoom_integration/utils.py, zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.py
Multi-line reformatting of guard condition logic and import statements; no functional changes.
Functional Enhancement
zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py
Added self.sync_registrations_from_zoom() call at the start of sync_attendance() to ensure registrations are synchronized from Zoom before processing attendance details.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Primary attention area: zoom_webinar.py — verify that calling sync_registrations_from_zoom() as a pre-step to sync_attendance() is intentional and does not introduce unintended side effects or performance concerns.

Poem

🐰 A hop, a skip, through code so neat,
We sync before we check—complete!
Registrations first, then attendance true,
Formatted lines make it all shine anew!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: sync registrations too with attendance' accurately and concisely describes the main change: adding registration synchronization as part of the attendance sync process.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06ab4dd and 5a6f218.

📒 Files selected for processing (3)
  • zoom_integration/utils.py (1 hunks)
  • zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py (1 hunks)
  • zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.py (1)
zoom_integration/zoom_integration/doctype/zoom_webinar_additional_param/zoom_webinar_additional_param.py (1)
  • ZoomWebinarAdditionalParam (8-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Server
🔇 Additional comments (3)
zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.py (1)

16-19: LGTM! Improved import readability.

The multi-line import format improves readability and follows Python conventions for long import paths.

zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py (1)

173-174: LGTM! Correct prerequisite sync.

Adding the registration sync before attendance sync ensures that registration records exist before creating attendance records that reference them (line 195-197).

zoom_integration/utils.py (1)

13-17: LGTM! Improved guard condition readability.

The multi-line format with explicit parentheses improves readability of the validation logic without changing behavior.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py (2)

333-334: Critical: Wrong flag set in registration sync method.

The sync_registrations_from_zoom() method incorrectly sets self.attendance_synced = 1. This flag should only be set by the sync_attendance() method. Consider introducing a separate flag (e.g., registrations_synced) or removing this line entirely if registration sync status doesn't need to be tracked.

🔎 Suggested fix
-		self.attendance_synced = 1
-		self.save()

Or introduce a new flag if tracking registration sync status is needed:

-		self.attendance_synced = 1
+		self.registrations_synced = 1
 		self.save()

266-270: Remove publish_progress calls per maintainer feedback.

The maintainer commented "Don't need the publish progress" in the PR discussion. Since sync_registrations_from_zoom() is now called from within sync_attendance(), these progress updates may create confusing or duplicate progress indicators.

🔎 Apply this diff to remove progress publishing
-		frappe.publish_progress(
-			percent=5,
-			title="Creating Registrant Records",
-			description=f"Creating records for {len(details)} unique registrants...",
-		)
-
 		# Process in batches to avoid memory issues
 			# Update progress after each batch
-			progress = 10 + ((processed_count / len(details)) * 85)
-			frappe.publish_progress(
-				percent=progress,
-				title="Creating Registrant Records",
-				description=f"Processed {processed_count} of {len(details)} registrants...",
-			)
-
 			# Commit batch to avoid long transactions
-		frappe.publish_progress(
-			percent=100,
-			title="Creating Registrant Records",
-			description=f"Successfully synced {processed_count} of {len(details)} registrants!",
-		)
-
 		if processed_count < len(details):

Also applies to: 324-328, 336-340

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06ab4dd and 5a6f218.

📒 Files selected for processing (3)
  • zoom_integration/utils.py (1 hunks)
  • zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py (1 hunks)
  • zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.py (1)
zoom_integration/zoom_integration/doctype/zoom_webinar_additional_param/zoom_webinar_additional_param.py (1)
  • ZoomWebinarAdditionalParam (8-24)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Server
🔇 Additional comments (3)
zoom_integration/zoom_integration/doctype/zoom_webinar_registration/zoom_webinar_registration.py (1)

16-19: LGTM! Improved import readability.

The multi-line import format improves readability and follows Python conventions for long import paths.

zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py (1)

173-174: LGTM! Correct prerequisite sync.

Adding the registration sync before attendance sync ensures that registration records exist before creating attendance records that reference them (line 195-197).

zoom_integration/utils.py (1)

13-17: LGTM! Improved guard condition readability.

The multi-line format with explicit parentheses improves readability of the validation logic without changing behavior.

@NagariaHussain NagariaHussain merged commit cfc47ab into BuildWithHussain:main Dec 26, 2025
4 checks passed
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