Context
In BookmarksProvider.createBookmarksClient (packages/modules/services/src/provider.ts), the response-validation operator for the bookmarks HTTP client is currently commented out:
public async createBookmarksClient<TMethod extends keyof ClientMethod>(
method: TMethod,
): Promise<BookmarksApiClient<TMethod, TClient>> {
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)
Context
In
BookmarksProvider.createBookmarksClient(packages/modules/services/src/provider.ts), the response-validation operator for the bookmarks HTTP client is currently commented out:It was disabled because the current
validateResponseoperator treats a404response to aHEADrequest (used to check bookmark existence) as an error, even though a 404 here is an expected/valid outcome.Task
404onHEADrequests from an actual error.httpClient.responseHandler.add('validate_api_request', validateResponse)once the operator supports this case.File
packages/modules/services/src/provider.ts(line ~160)