Cht-core: Remove the ability to set the user's language via the API

Created on 19 Apr 2021  路  4Comments  路  Source: medic/cht-core

Describe the bug
Continuing on from #6972 where we removed the ability to set the user's language in the admin app, we should also remove it from the API and accompanying documentation.

To maintain backwards compatibility make sure the endpoint continues to work when given a language.

To Reproduce
Steps to reproduce the behavior:

  1. POST to /api/v1/users to set the user's language

Expected behavior
The database isn't updated. No errors are thrown. The language property is ignored, either silently or with a warning only.

Logs
None.

Environment
N/A

Help wanted Bug

All 4 comments

@garethbowen to clarify, is the goal of this issue to remove the ability to set the language via the users service completely (as hinted in your comments on https://github.com/medic/cht-core/pull/7049) or to just remove the ability to configure the user's language via the /api/v1/users endpoint (but still retain the functionality in the users service for setting the language since it is used to set the language based on the locale selected when logging in: https://github.com/medic/cht-core/blob/87aa90660ea7fcb41f46f7dcdef4bd1f21de6022/api/src/controllers/login.js#L165)?

@jkuester Great spotting. I think we can remove that call altogether. It sets the language in the database but that's never used anywhere!

I'm echoing this message here, for clarity.

If we remove the language update from user-settings, then we should add some other way of determining which languages the users are currently using. One option would be telemetry, but that would mean that data is relatively stale.
Knowing which language the users are using is important for debugging and probably for data analysis as well.

Added issue for storing users language in Telemetry and Feedback documents: https://github.com/medic/cht-core/issues/7089
These two issues should be scheduled together.

Was this page helpful?
0 / 5 - 0 ratings