Skip to content

fix(dispute-evidence): remove NEXT_PUBLIC_USE_MOCKS feature flag#298

Open
Benjtalkshow wants to merge 1 commit into
OFFER-HUB:mainfrom
Benjtalkshow:fix/remove-use-mocks-dispute-evidence
Open

fix(dispute-evidence): remove NEXT_PUBLIC_USE_MOCKS feature flag#298
Benjtalkshow wants to merge 1 commit into
OFFER-HUB:mainfrom
Benjtalkshow:fix/remove-use-mocks-dispute-evidence

Conversation

@Benjtalkshow

@Benjtalkshow Benjtalkshow commented Jun 17, 2026

Copy link
Copy Markdown

Closes #290

What this does

Removes the NEXT_PUBLIC_USE_MOCKS feature flag from src/lib/api/dispute-evidence.ts.

The file used to read process.env.NEXT_PUBLIC_USE_MOCKS and, when it was set, returned fake evidence objects instead of calling the real API. The flag wasn't documented anywhere, so if it ever got set by accident in a deployment, the app would quietly serve fabricated data instead of real dispute evidence.

Changes

  • Removed the USE_MOCKS constant
  • Removed the mock branches in uploadDisputeEvidence, listDisputeEvidence and deleteDisputeEvidence
  • All three functions now always call the real API endpoints
  • Errors still propagate to the UI as before (nothing changed there)

Notes

  • NEXT_PUBLIC_USE_MOCKS was not present in .env.example or any config, so nothing to clean up there.
  • This file didn't import any mock data from dispute.data.ts, so no import cleanup needed.
  • A repo-wide search confirms there are no remaining references to the flag, and tsc --noEmit passes for the file.

The dispute evidence API read NEXT_PUBLIC_USE_MOCKS and, when set,
returned fabricated evidence instead of hitting the real endpoints.
The flag was undocumented, so an accidental deployment setting could
silently serve fake data.

Drop the USE_MOCKS constant and the mock branches in
uploadDisputeEvidence, listDisputeEvidence and deleteDisputeEvidence
so all three always call the real API. Errors continue to propagate
to the UI.
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.

Fix: Remove NEXT_PUBLIC_USE_MOCKS feature flag from dispute-evidence.ts

1 participant