Revert "AAE-48166 Compensate for VM/Citrix clock drift in token expiry check (#12024)" (#12111)

This reverts commit ce907417b7.
This commit is contained in:
Amedeo Lepore
2026-07-31 09:55:30 +01:00
committed by GitHub
parent 9587995ac3
commit 8ebbfa819e
13 changed files with 247 additions and 1461 deletions
@@ -213,23 +213,6 @@ describe('AdfHttpClient', () => {
req.flush(errorResponse, { status: 403, statusText: 'Forbidden' });
});
it('should return a meaningful error message when response body is null', (done) => {
const options: RequestOptions = {
path: '',
httpMethod: 'POST'
};
angularHttpClient.request('http://example.com', options, securityOptions, emitters).catch((err: AlfrescoApiResponseError) => {
expect(err instanceof Error).toBeTruthy();
expect(err.message).toBe('401 Unauthorized');
expect(err.status).toBe(401);
done();
});
const req = controller.expectOne('http://example.com');
req.flush(null, { status: 401, statusText: 'Unauthorized' });
});
it('should return a Error type on failed promise with response body', (done) => {
const options: RequestOptions = {
path: '',
@@ -223,14 +223,7 @@ export class AdfHttpClient implements JsApiHttpClient {
// for backwards compatibility we need to convert it to error class as the HttpErrorResponse only implements Error interface, not extending it,
// and we need to be able to correctly pass instanceof Error conditions used inside repository
// we also need to pass error as Stringify string as we are detecting statusCodes using JSON.parse(error.message) in some places
let msg: string;
if (err.error == null) {
msg = `${err.status} ${err.statusText ?? 'Unknown error'}`;
} else if (typeof err.error === 'string') {
msg = err.error;
} else {
msg = JSON.stringify(err.error);
}
const msg = typeof err.error === 'string' ? err.error : JSON.stringify(err.error);
// for backwards compatibility to handle cases in code where we try read response.error.response.body;