fix(zohocalendar): suppress Zoho notification emails#29600
Conversation
|
Welcome to Cal.diy, @RussianCow! Thanks for opening this pull request. A few things to keep in mind:
A maintainer will review your PR soon. Thanks for contributing! |
📝 WalkthroughWalkthroughThe 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/app-store/zohocalendar/lib/__tests__/CalendarService.test.ts (1)
169-176: ⚡ Quick winAssert the DELETE
etagheader in this test.This test verifies
notify_attendee, but it should also assert the forwardedetagsince delete now depends on it.Suggested patch
const deleteCall = fetchMock.mock.calls[1] as [string, RequestInit]; const [requestUrl, requestInit] = deleteCall; expect(requestUrl).toContain(`/calendars/849d6badb4e04acc91860c43db0fb109/events/${mockEventUid}`); expect(requestInit.method).toBe("DELETE"); + expect(requestInit.headers as Record<string, string>).toMatchObject({ + etag: "1669788841981", + }); const eventData = parseEventDataFromRequestUrl(requestUrl); expect(eventData.notify_attendee).toBe(0); expect(eventData.uid).toBe(mockEventUid);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/app-store/zohocalendar/lib/__tests__/CalendarService.test.ts` around lines 169 - 176, Add an assertion to verify that the etag header is forwarded in the DELETE request. After the existing assertions that check requestInit.method, notify_attendee, and uid, add a new assertion to verify that the etag header is present in the requestInit.headers object. This ensures the delete operation has the required etag dependency that the code now relies on.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/app-store/zohocalendar/lib/__tests__/CalendarService.test.ts`:
- Around line 169-176: Add an assertion to verify that the etag header is
forwarded in the DELETE request. After the existing assertions that check
requestInit.method, notify_attendee, and uid, add a new assertion to verify that
the etag header is present in the requestInit.headers object. This ensures the
delete operation has the required etag dependency that the code now relies on.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: af92b78b-e72f-4bff-850f-cd5a077d8dd5
📒 Files selected for processing (2)
packages/app-store/zohocalendar/lib/CalendarService.tspackages/app-store/zohocalendar/lib/__tests__/CalendarService.test.ts
There was a problem hiding this comment.
hey @RussianCow , can u please add a visual demo for this? Making it draft til then
|
@bandhan-majumder Sure! What would you like me to demo, exactly? Receiving two separate emails for a booking? |
|
the expected result as u mentioned in the issue: |
What does this PR do?
Suppress Zoho Calendar event notification emails so that two emails are not sent with every booking.
Mandatory Tasks (DO NOT REMOVE)
How should this be tested?