prompt-injection icon indicating copy to clipboard operation
prompt-injection copied to clipboard

Share common constants across backend to frontend via API request

Open pmarsh-scottlogic opened this issue 2 years ago • 1 comments

Refactor

Description

Right now, some constants:

  • CONFIG_VALUE_CHARACTER_LIMIT
  • MESSAGE_CHARACTER_LIMIT
  • Are there any more?? have to be duplicated across the backend, frontend and tests, violating DRY. We should instead store them in one place in the backend, then ping them across to the frontend in an initial API request.

Acceptance criteria

The above mentioned constants should only be declared once in the entire codebase. After the refactor, the app should behave identically. So in terms of testing, we just need to consider regression.

pmarsh-scottlogic avatar Nov 13 '23 10:11 pmarsh-scottlogic

Could be good to do with #300

gsproston-scottlogic avatar Nov 22 '23 14:11 gsproston-scottlogic