Skip to content

backend/fix:- Returing empty response in case of kapture when config …#1351

Open
Kuldeepkumawat144 wants to merge 1 commit into
mainfrom
backend/fix/kaptureTicket
Open

backend/fix:- Returing empty response in case of kapture when config …#1351
Kuldeepkumawat144 wants to merge 1 commit into
mainfrom
backend/fix/kaptureTicket

Conversation

@Kuldeepkumawat144

@Kuldeepkumawat144 Kuldeepkumawat144 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

…is set to Zendesk

Type of Change

  • [ X] Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates

Description

Additional Changes

  • This PR modifies the database schema (database migration added)
  • This PR modifies dhall configs/environment variables

Motivation and Context

How did you test it?

Checklist

  • I formatted the code and addressed linter errors ./dev/format-all-files.sh
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

Summary by CodeRabbit

  • Bug Fixes
    • Fixed errors in Zendesk ticket operations. The system now returns appropriate stub responses with success indicators instead of throwing errors when processing Zendesk configurations, enabling graceful degradation of operations.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This change converts ZendeskConfig branches across five Kapture-related operations from throwing InternalError to returning type-appropriate "successful but not applicable" stub responses. Error-handling imports are removed, and each operation now returns empty or zero values wrapped in its expected response type.

Changes

Zendesk Stub Response Conversion

Layer / File(s) Summary
Import cleanup and ZendeskConfig stub responses
lib/mobility-core/src/Kernel/External/Ticket/Interface.hs
Error-handling imports (Kernel.Types.Error, Kernel.Utils.Error.Throwing) are removed. All five Kapture operations (addAndUpdateKaptureCustomer, kaptureEncryption, kapturePullTicket, kaptureGetTicket, getTicketStatus) update their ZendeskConfig branches to return stub success values: customer responses with empty IDs, encryption responses with success flags, pull/get responses with zero counts and empty lists.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • nammayatri/shared-kernel#1297: The main PR changes Kernel.External.Ticket.Interface to stop ZendeskConfig branches from throwError-ing and instead return stub success responses for the Kapture/Zendesk operations, directly aligning with (and correcting) the Zendesk-rejection behavior introduced in PR #1297's Interface.hs.

Suggested reviewers

  • khuzema786
  • Vignesh-772
  • prakharritik

Poem

A rabbit bounces through the code,
Where Zendesk errors once exploded,
Now stubs return with grace so bright,
No more exceptions in the night! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title partially relates to the changeset but is incomplete and contains a typo ('Returing' instead of 'Returning'). It refers to returning empty responses for Kapture with Zendesk config, which matches the main change, but the truncation with '…' obscures the full intent. Complete the title to fully describe the change and fix the typo: 'backend/fix: Return empty response for Kapture operations when Zendesk config is set' or similar.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backend/fix/kaptureTicket

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@lib/mobility-core/src/Kernel/External/Ticket/Interface.hs`:
- Line 72: The branches that match ZendeskConfig currently return success-shaped
placeholders (e.g., KT.KaptureCustomerResp {message = "Not applicable for
Zendesk", status = "ok", ...}) which collapses “unsupported provider” into a
normal success; change those branches (the ZendeskConfig matches in the
functions returning KT.KaptureCustomerResp and the analogous ZendeskConfig cases
for pull/get/status flows) to return an explicit unsupported signal instead of a
success-shaped value: either restore the prior error path (e.g., return a
Left/throw an appropriate error) or introduce and return a dedicated
NotApplicable/Unsupported constructor in the KT response types and adjust
callers to handle it; update the pattern-matched branches (the ZendeskConfig
case sites and any functions creating KT.KaptureCustomerResp or the
encrypted-payload responses) to produce that explicit unsupported result rather
than "status = \"ok\"" or empty IDs/payloads.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0cae6024-bfc7-4a59-901c-b07cac8c6da8

📥 Commits

Reviewing files that changed from the base of the PR and between c72fffc and 8e9b033.

📒 Files selected for processing (1)
  • lib/mobility-core/src/Kernel/External/Ticket/Interface.hs

Comment thread lib/mobility-core/src/Kernel/External/Ticket/Interface.hs
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