Skip to content

Replace Axios with fetch outside MeSH provider - #798

Open
floze-the-genius wants to merge 1 commit into
gbv:devfrom
floze-the-genius:refactor/787-use-fetch
Open

floze-the-genius wants to merge 1 commit into
gbv:devfrom
floze-the-genius:refactor/787-use-fetch

Conversation

@floze-the-genius

Copy link
Copy Markdown

Summary

  • replace the simple Axios GET calls in the store and concept details with a small fetchJson helper that preserves non-2xx error handling
  • replace mapping-browser cancel tokens with AbortController signals passed through cocoda-sdk
  • ignore superseded aborts while still surfacing genuine registry request failures

Refs #787.

The custom MeSH provider is intentionally unchanged because its move/removal is tracked separately by #786.

Validation

  • npm run lint (passes with the two existing component-name warnings in src/main.js)
  • npm run build
  • direct success/non-2xx contract check for fetchJson
  • delayed local HTTP request proving that cocoda-sdk propagates the AbortSignal and cancels the request

Implementation and validation were assisted by Codex.

@nichtich

Copy link
Copy Markdown
Member

Thanks for your contribution. This first needs to be tested by hand in a live instance of Cocoda application, in particular because HTTP calls from browser are slightly different then HTTP calls from NodeJS. We also plan to remove axios in dependency cocoda-sdk, to a thin class HTTPClient is favoured over utility function fetchJSON.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants