PagerDuty / backstage-plugin-backend

PagerDuty plugin for Backstage - Backend
https://pagerduty.github.io/backstage-plugin-docs/index.html
Apache License 2.0
3 stars 6 forks source link

Calls to the backend API hangs forever #37

Closed pcgqueiroz closed 5 months ago

pcgqueiroz commented 5 months ago

Describe the bug The PagerDuty card never loads because the call from the frontend to the backend plugin API hangs forever. With some debugs, I could find out that the code hangs on the fetch function call.

To Reproduce I am behind a corporate proxy, maybe that's the reason why.

Expected behavior The fetch function should return.

Solution I have imported the fetch function from node-fetch package as recommended by the Backstage team in ADR013: Proper use of HTTP fetching libraries and it solved the bug.

In file pagerduty.ts, I have just added these following lines:

import fetch from 'node-fetch';
import type { RequestInit, Response } from 'node-fetch';

The node-fetch package is already imported in the package.json file: https://github.com/PagerDuty/backstage-plugin-backend/blob/main/package.json#L34

t1agob commented 5 months ago

I'll look into this ASAP from a frontend and backend perspective and run end-to-end tests before merging.

@pcgqueiroz I'll probably will need your help to validate that it works behind a proxy since I don't have easy access to that type of environment. Would that be ok?

t1agob commented 5 months ago

@pcgqueiroz which version of the frontend, backend and common plugins are you using and getting this error?

pcgqueiroz commented 5 months ago

I'll look into this ASAP from a frontend and backend perspective and run end-to-end tests before merging.

@pcgqueiroz I'll probably will need your help to validate that it works behind a proxy since I don't have easy access to that type of environment. Would that be ok?

Sure, no problem.

pcgqueiroz commented 5 months ago

@pcgqueiroz which version of the frontend, backend and common plugins are you using and getting this error?

"@pagerduty/backstage-plugin": "^0.9.2",
"@pagerduty/backstage-plugin-backend": "^0.4.3"
"@pagerduty/backstage-plugin-common": "^0.1.1"
t1agob commented 5 months ago

This issue is solved in #38 and is available on version 0.4.6.