equinor / equinor/fusion-framework

services module: re-enable bookmarks response validation once new ResponseOperator is available

Open
#5,157 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
10
Forks
10
Avg merge
19h 40m
Merged PRs (30d)
150

Description

## Context

In `BookmarksProvider.createBookmarksClient` (`packages/modules/services/src/provider.ts`), the response-validation operator for the bookmarks HTTP client is currently commented out:

```ts
public async createBookmarksClient(
method: TMethod,
): Promise> {
const httpClient = await this._createClientFn('bookmarks');
// TODO: update when new ResponseOperator is available
// will fail because 'HEAD' will return 404 when no bookmarks are found
// httpClient.responseHandler.add('validate_api_request', validateResponse);
return new BookmarksApiClient(httpClient, method);
}
```

It was disabled because the current `validateResponse` operator treats a `404` response to a `HEAD` request (used to check bookmark existence) as an error, even though a 404 here is an expected/valid outcome.

## Task

- Update or replace the response operator so it can distinguish an expected `404` on `HEAD` requests from an actual error.
- Re-enable `httpClient.responseHandler.add('validate_api_request', validateResponse)` once the operator supports this case.

## File

`packages/modules/services/src/provider.ts` (line ~160)

Contributor guide

Open the contributing guide

Research direction

Start in packages/modules/services/src/provider.ts at BookmarksProvider.createBookmarksClient, then locate validateResponse and the ResponseOperator implementation. Verify how HEAD requests and 404 responses are handled, update the operator to allow the documented expected case, and confirm the validate_api_request handler is re-enabled without treating valid bookmark checks as errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.