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

fix: endpoints returning status code 500 #501

Open
wants to merge 3 commits into
base: staging
Choose a base branch
from

Conversation

afkzoro
Copy link
Contributor

@afkzoro afkzoro commented Oct 24, 2024

What kind of PR is this?:

/kind fix

What this PR does / why we need it:

Fixes a couple of endpoints in the admin gateway, returning status code 500.

Which issue(s) does this PR fixes?:

Fixes #

Additional comments?:

Developer Checklist:

  • Read your code changes at least once
  • Tested on iOS/Android device (e.g, No crashes, library supported etc.)
  • No console errors on web
  • Tested on Light mode and Dark mode*
  • Your UI implementation visually matched the rendered design*
  • Unit tests*
  • Added e2e tests*
  • Added translations*

@@ -124,7 +124,7 @@ export class OrdersController {
streamUpdates: true
}
return await lastValueFrom<ResponseWithStatus>(
this.ordersClient.send(QUEUE_MESSAGE.UPDATE_ORDER_STATUS, payload).pipe(
this.ordersClient.emit(QUEUE_MESSAGE.UPDATE_ORDER_STATUS, payload).pipe(
Copy link
Member

Choose a reason for hiding this comment

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

Incorrect. Send is the correct method. refer to line 69 in order-service.controller.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

send returns 500.

Copy link
Member

Choose a reason for hiding this comment

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

Even so but that doesnt solve the underlying issue. Check if anything is getting returned

Copy link
Member

Choose a reason for hiding this comment

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

image

Wrap the code in the circle in an observable. lastValueFrom

Copy link
Member

Choose a reason for hiding this comment

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

Please learn to look at for root cause when debugging. If something doesnt make sense and it works, there is something definitely wrong

Copy link
Contributor Author

@afkzoro afkzoro Oct 26, 2024

Choose a reason for hiding this comment

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

The request body still reaches the orders controller if send or emit is used. The error is only thrown from the admin gateway.

Tested with and without the lastValueFrom observable

@@ -123,6 +123,7 @@ export class OrdersController {
...data,
streamUpdates: true
}
console.log(payload)
Copy link
Member

Choose a reason for hiding this comment

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

Remove the log

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done @siradji

@afkzoro afkzoro requested a review from siradji October 30, 2024 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants