Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 パスからチャンネルを取得するときの動作を修正 #2590

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

YuHima03
Copy link
Contributor

fix #2587

  • /channelspath パラメーターをつけたときの動作を修正した.
    • チャンネルが存在しないときに 404 NotFound を返すようにした.
    • 返される値の型が, path パラメーターが無いときと同になるようにした.
  • /channels?path= のテストを追加した.

Summary by Copilot

This pull request includes several changes to the router/v3/channels.go file to improve the handling of channel paths and error responses, as well as updates to the corresponding tests. The most important changes include adding error handling for invalid channel paths, modifying the response structure, and enhancing the test coverage for these scenarios.

Error Handling Improvements:

  • Added error handling for invalid channel paths in GetChannels function, returning a 404 Not Found status when the path is invalid.

Response Structure Modifications:

  • Modified the response structure in GetChannels function to properly format channels and include subchannels in the response. [1] [2]

Test Coverage Enhancements:

  • Added a new helper function CreateSubchannel in router_test.go to create subchannels for testing purposes.
  • Updated the TestHandlers_GetChannels test function to include checks for subchannels and validate the new error handling for invalid paths. [1] [2] [3] [4] [5]

These changes ensure that the channel handling logic is more robust and that the test suite accurately reflects the new behavior.

@YuHima03 YuHima03 changed the title 🐛 🐛 パスからチャンネルを取得するときの動作を修正 Feb 25, 2025
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