Skip to content

feat: add msw API handlers for development#183

Merged
iamitprakash merged 8 commits intochore/msw-mock-datafrom
feat/add-msw-handlers
Aug 19, 2025
Merged

feat: add msw API handlers for development#183
iamitprakash merged 8 commits intochore/msw-mock-datafrom
feat/add-msw-handlers

Conversation

@AnujChhikara
Copy link
Contributor

@AnujChhikara AnujChhikara commented Aug 15, 2025

Date: 25 Aug 2025

Developer Name: @AnujChhikara


Issue Ticket Number

Description

  • Added the API handlers for all the APIs for local development

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1
screen-recording-2025-08-18-at-10852-pm_fvOZ5bHR.mp4

Test Coverage

Screenshot 1

Additional Notes

Description by Korbit AI

What change is being made?

Add mock API handlers using MSW (Mock Service Worker) for the development environment, covering labels, tasks, teams, users, and watchlist functionality.

Why are these changes being made?

These changes are being introduced to enable efficient development and testing workflows by providing a way to simulate real API behavior without making actual network requests. This setup supports the frontend application by allowing it to interact with mock data for different scenarios, facilitating quicker and more reliable integration testing.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

@korbit-ai
Copy link

korbit-ai bot commented Aug 15, 2025

Based on your review schedule, I'll hold off on reviewing this PR until it's marked as ready for review. If you'd like me to take a look now, comment /korbit-review.

Your admin can change your review schedule in the Korbit Console

@coderabbitai
Copy link

coderabbitai bot commented Aug 15, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/add-msw-handlers

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@AnujChhikara AnujChhikara marked this pull request as ready for review August 16, 2025 06:53
Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Readability Untyped Error Parameter ▹ view
Logging Missing Mock Response Debug Logs ▹ view
Readability Magic number in default parameter ▹ view
Functionality Invalid MSW URL Pattern ▹ view
Error Handling Invalid Error Response Structure ▹ view ✅ Fix detected
Security Unsanitized URL Path Parameter ▹ view ✅ Fix detected
Error Handling Loss of Error Context in Response ▹ view ✅ Fix detected
Logging Direct Console Usage Instead of Logger ▹ view
Functionality Missing Pagination Parameter Validation ▹ view ✅ Fix detected
Design Inadequate Error Handling Strategy ▹ view ✅ Fix detected
Files scanned
File Path Reviewed
mocks/utils/common.ts
mocks/handlers/index.ts
mocks/handlers/labels.handler.ts
mocks/handlers/users.handler.ts
mocks/data/labels.mock.ts
mocks/data/users.mock.ts
mocks/handlers/teams.handler.ts
mocks/data/watchlist.mock.ts
mocks/handlers/tasks.handler.ts
mocks/data/teams.mock.ts
mocks/data/tasks.mock.ts

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

@AnujChhikara AnujChhikara self-assigned this Aug 18, 2025
@iamitprakash iamitprakash merged commit 1d749e1 into chore/msw-mock-data Aug 19, 2025
2 checks passed
@iamitprakash iamitprakash deleted the feat/add-msw-handlers branch August 19, 2025 19:12
iamitprakash pushed a commit that referenced this pull request Aug 19, 2025
* chore: removed unused mock files and add mock data for msw

* refactor(mocks): export mock data for labels, tasks, teams, users, and watchlist

* feat: add msw API handlers for development (#183)

* refactor(mocks): remove unused Task and Team mock files

* fix(mocks): start mocking before API calls to prevent race conditions

* refactor(mocks): export handlers

* refactor(mocks): enhance task labels handling in mock data

* refactor(mocks): integrate user assignment in task creation for mock data

* refactor(mocks): improve error handling and response structure in mock API handlers
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.

3 participants