Skip to content

fix: check registration exist or not#4

Merged
NagariaHussain merged 3 commits into
BuildWithHussain:mainfrom
vishwajeet-13:fix/sync-registrations
Jan 13, 2026
Merged

fix: check registration exist or not#4
NagariaHussain merged 3 commits into
BuildWithHussain:mainfrom
vishwajeet-13:fix/sync-registrations

Conversation

@vishwajeet-13
Copy link
Copy Markdown
Contributor

@vishwajeet-13 vishwajeet-13 commented Jan 13, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Prevented duplicate webinar registrations during Zoom sync by detecting existing registrants for the same webinar and skipping duplicates, improving data accuracy.
  • Chores

    • Updated continuous integration setup to use newer runtime environments to keep build tooling current.

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

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 13, 2026

📝 Walkthrough

Walkthrough

Adds a deduplication check in sync_registrations_from_zoom to skip creating a "Zoom Webinar Registration" when a record with the same registrant_id and webinar name already exists; also updates CI workflow runtimes (Python and Node versions).

Changes

Cohort / File(s) Summary
Deduplication Logic
zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py
Adds a pre-insert check in sync_registrations_from_zoom to detect existing registrations by registrant_id and webinar name and skip duplicate creation.
CI Workflow
.github/workflows/ci.yml
Updates CI setup to use newer runtimes: Python 3.103.14 and Node 1824.

Sequence Diagram(s)

(omitted — change is a small control-flow dedupe and CI runtime update, not warranting a multi-component sequence diagram)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hopped through webinar rows,
I checked each registrant's nose,
If a twin was found in store,
I skipped and hopped on more,
Registrations tidy as it goes ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 describes the main change: adding a deduplication check for registrations in the zoom_webinar.py file. However, it is somewhat vague and could be more descriptive about what 'check' means (e.g., 'check for duplicates').

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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: 1

🤖 Fix all issues with AI agents
In @zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py:
- Around line 281-289: The if-block checking for duplicates has misaligned
indentation causing ruff-format failure; locate the block that calls
frappe.db.exists with keys ("Zoom Webinar Registration", {"registrant_id":
registrant.get("id"), "webinar": self.name}) and re-indent so the if line, its
condition block, and the subsequent continue statement are at the same
indentation level (i.e., the continue is inside the if body). Ensure the
conditional and continue are consistently indented with the surrounding loop
(where registrant is iterated) so formatting and linting pass.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cfc47ab and 93ba47d.

📒 Files selected for processing (1)
  • zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py
🧰 Additional context used
🪛 GitHub Actions: Linters
zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py

[error] 278-278: pre-commit hook ruff-format reformatted 1 file and failed. Hook 'ruff-format' changed files; run 'pre-commit run --all-files' to re-verify. Process completed with exit code 1.

Comment thread zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py Outdated
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

🧹 Nitpick comments (1)
zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py (1)

281-288: Good deduplication check, but progress reporting may be misleading.

The existence check is an efficient way to avoid unnecessary document creation overhead. However, the current implementation silently skips duplicates without tracking them, which causes the final message (lines 350-355) to incorrectly attribute skipped duplicates to "errors."

Consider tracking duplicates separately to provide accurate feedback:

♻️ Suggested improvement for accurate reporting
 			batch_size = ATTENDANCE_SYNC_BATCH_SIZE
 			processed_count = 0
+			skipped_duplicates = 0

 			for i in range(0, len(details), batch_size):
 				batch = details[i : i + batch_size]

 				for registrant in batch:
 					try:
 						if frappe.db.exists(
 							"Zoom Webinar Registration",
 							{
 								"registrant_id": registrant.get("id"),
 								"webinar": self.name,
 							},
 						):
+							skipped_duplicates += 1
 							continue

Then update the final message to distinguish duplicates from errors:

 			if processed_count < len(details):
+				error_count = len(details) - processed_count - skipped_duplicates
 				frappe.msgprint(
-					f"Synced {processed_count} out of {len(details)} registrants. "
-					f"{len(details) - processed_count} records had errors and were skipped. "
-					"Check the Error Log for details."
+					f"Synced {processed_count} out of {len(details)} registrants. "
+					f"{skipped_duplicates} duplicates skipped. "
+					+ (f"{error_count} records had errors (see Error Log)." if error_count > 0 else "")
 				)
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 93ba47d and 559604e.

📒 Files selected for processing (1)
  • zoom_integration/zoom_integration/doctype/zoom_webinar/zoom_webinar.py

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: 1

🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Around line 51-55: The workflow uses actions/setup-node@v3 which is outdated
for Node.js 24; update the action reference from actions/setup-node@v3 to
actions/setup-node@v4 to ensure compatibility with current runners, and while
editing also consider updating related action versions for consistency (e.g.,
actions/checkout@v3 → actions/checkout@v4 and actions/setup-python@v4 →
actions/setup-python@v5) so all setup actions target their current major
releases.
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 559604e and 221c892.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml
🧰 Additional context used
🪛 actionlint (1.7.10)
.github/workflows/ci.yml

52-52: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ 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 (1)
.github/workflows/ci.yml (1)

46-49: Python 3.14 is the latest stable release — looks good.

Python 3.14 was released on 7 October 2025 and is the current stable version with significant improvements including template string literals, deferred evaluation of annotations, and support for subinterpreters in the standard library.

Ensure that frappe-bench and other dependencies are compatible with Python 3.14, as some libraries may lag behind on compatibility with the latest Python release.

Comment thread .github/workflows/ci.yml
Comment on lines 51 to 55
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 24
check-latest: true
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Node.js 24 is LTS — update actions/setup-node to v4.

Node.js 24.x has entered Long Term Support (LTS) with the codename 'Krypton' and will continue to receive updates through to the end of April 2028. The version choice is appropriate.

However, static analysis flagged that actions/setup-node@v3 is too old to run on current GitHub Actions runners. Update to v4 for compatibility.

🔧 Suggested fix
      - name: Setup Node
-       uses: actions/setup-node@v3
+       uses: actions/setup-node@v4
        with:
          node-version: 24
          check-latest: true

For consistency, also consider updating the other actions:

  • actions/checkout@v3actions/checkout@v4 (line 39)
  • actions/setup-python@v4actions/setup-python@v5 (line 47)
🧰 Tools
🪛 actionlint (1.7.10)

52-52: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
In @.github/workflows/ci.yml around lines 51 - 55, The workflow uses
actions/setup-node@v3 which is outdated for Node.js 24; update the action
reference from actions/setup-node@v3 to actions/setup-node@v4 to ensure
compatibility with current runners, and while editing also consider updating
related action versions for consistency (e.g., actions/checkout@v3 →
actions/checkout@v4 and actions/setup-python@v4 → actions/setup-python@v5) so
all setup actions target their current major releases.

@vishwajeet-13
Copy link
Copy Markdown
Contributor Author

@NagariaHussain @Rl0007

@NagariaHussain NagariaHussain merged commit 3508d4e into BuildWithHussain:main Jan 13, 2026
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