* Retrieves the URL for the Alive websocket. * * @returns The websocket URL if the request succeeded, null if the request * failed with 404, otherwise it will throw an error. * * This behavior is expected by the AliveSession class constructor, to prevent * it from hitting the endpo
()
| 883 | * it from hitting the endpoint many times if it's disabled. |
| 884 | */ |
| 885 | public async getAliveWebSocketURL(): Promise<string | null> { |
| 886 | try { |
| 887 | const res = await this.ghRequest('GET', '/alive_internal/websocket-url') |
| 888 | if (res.status === HttpStatusCode.NotFound) { |
| 889 | return null |
| 890 | } |
| 891 | const websocket = await parsedResponse<IAPIAliveWebSocket>(res) |
| 892 | return websocket.url |
| 893 | } catch (e) { |
| 894 | log.warn(`Alive web socket request failed: ${e}`) |
| 895 | throw e |
| 896 | } |
| 897 | } |
| 898 | |
| 899 | /** |
| 900 | * Fetch an issue comment (i.e. a comment on an issue or pull request). |
no test coverage detected