Skip to content

properly handle instances that have empty settings

Administrator requested to merge sg/empty-settings into master

Created by: slimsag

In older (2.x) versions of Sourcegraph it was possible to save an empty string as your user/org/global settings. This lead to various issues including just completely breaking the settings page: https://github.com/sourcegraph/sourcegraph/issues/1645

We later fixed that issue and made it such that saving empty settings is forbidden, but it doesn't appear we ever corrected such invalid settings. In one customer environment we've encountered a user who is reporting their settings are empty so we should handle this.

This is a quick fix which is cheap for us to maintain, so I opted for this approach for now. The more correct (but also more complex) approach would be to write a migration which transforms any empty settings into non-empty ones. I don't think it is worth the time it would take right now.

Once merged, this will be released in 3.4.1 and can optionally be released as a patch on the customer's older version if @beyang desires.

Test plan: none

Merge request reports

Loading