update backend stuck/stall

This commit is contained in:
Matthias Hochmeister
2026-03-13 08:30:05 +01:00
parent 60488309ca
commit 243da302c7
9 changed files with 199 additions and 156 deletions

View File

@@ -1,4 +1,5 @@
import axios from 'axios';
import httpClient from '../config/httpClient';
import environment from '../config/environment';
import logger from '../utils/logger';
@@ -82,7 +83,7 @@ async function initiateLoginFlow(): Promise<LoginFlowResult> {
}
try {
const response = await axios.post(`${baseUrl}/index.php/login/v2`);
const response = await httpClient.post(`${baseUrl}/index.php/login/v2`);
return {
loginUrl: response.data.login,
pollToken: response.data.poll.token,
@@ -105,7 +106,7 @@ async function pollLoginFlow(pollEndpoint: string, pollToken: string): Promise<L
throw new Error('pollEndpoint is not a valid service URL');
}
try {
const response = await axios.post(pollEndpoint, `token=${pollToken}`, {
const response = await httpClient.post(pollEndpoint, `token=${pollToken}`, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
});
return {
@@ -146,7 +147,7 @@ async function getAllConversations(loginName: string, appPassword: string): Prom
}
try {
const response = await axios.get(
const response = await httpClient.get(
`${baseUrl}/ocs/v2.php/apps/spreed/api/v4/room?format=json`,
{
headers: {
@@ -201,7 +202,7 @@ async function getMessages(token: string, loginName: string, appPassword: string
}
try {
const response = await axios.get(
const response = await httpClient.get(
`${baseUrl}/ocs/v2.php/apps/spreed/api/v1/chat/${encodeURIComponent(token)}`,
{
params: { lookIntoFuture: 0, limit: 50, setReadMarker: 0 },
@@ -250,7 +251,7 @@ async function sendMessage(token: string, message: string, loginName: string, ap
}
try {
await axios.post(
await httpClient.post(
`${baseUrl}/ocs/v2.php/apps/spreed/api/v1/chat/${encodeURIComponent(token)}`,
{ message },
{
@@ -287,7 +288,7 @@ async function markAsRead(token: string, loginName: string, appPassword: string)
}
try {
await axios.post(
await httpClient.post(
`${baseUrl}/ocs/v2.php/apps/spreed/api/v1/chat/${encodeURIComponent(token)}/read`,
{ lastReadMessage: null },
{
@@ -324,7 +325,7 @@ async function getConversations(loginName: string, appPassword: string): Promise
}
try {
const response = await axios.get(
const response = await httpClient.get(
`${baseUrl}/ocs/v2.php/apps/spreed/api/v4/room?format=json`,
{
headers: {