Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a @medic/constants shared library #9621

Open
dianabarsan opened this issue Nov 6, 2024 · 2 comments
Open

Add a @medic/constants shared library #9621

dianabarsan opened this issue Nov 6, 2024 · 2 comments
Labels
Type: Technical issue Improve something that users won't notice

Comments

@dianabarsan
Copy link
Member

Describe the issue
We have a bunch of magic strings spread throughout the app.
One of the prominent ones being mm-online: https://github.com/search?q=repo%3Amedic%2Fcht-core+mm-online&type=code
This is not the only example.

Describe the improvement you'd like
Collect all reused magic strings and add them to a shared library.

@dianabarsan dianabarsan added the Type: Technical issue Improve something that users won't notice label Nov 6, 2024
@garethbowen
Copy link
Member

Examples I can think of...

  • mm-online
  • X-Request-Id
  • _local/transitions-seq
  • _local/background-seq
  • doc types, eg: translations
  • doc IDs, eg: service-worker-meta

@dianabarsan
Copy link
Member Author

Thanks for adding to the list. I agree with all these suggestions.
We also have X-Medic-Service header that we pass to haproxy in both api and sentinel.
For doc ids, we can also make it return translation doc names like (code) => messages-${code}.
Same applies to form names, other docs that have prefixes (org.couchdb.user:).

I think we're going to end up with a sizeable list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Technical issue Improve something that users won't notice
Projects
None yet
Development

No branches or pull requests

2 participants