-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Labels
issue/regressionIndicates a previously functioning feature or behavior that has broken or regressed after a changeIndicates a previously functioning feature or behavior that has broken or regressed after a changetype/bug
Description
Regression of #22295
Lines 151 to 162 in b383652
// SetUserSetting updates a users' setting for a specific key | |
func SetUserSetting(userID int64, key, value string) error { | |
if err := validateUserSettingKey(key); err != nil { | |
return err | |
} | |
_, err := cache.GetString(genSettingCacheKey(userID, key), func() (string, error) { | |
return value, upsertUserSettingValue(userID, key, value) | |
}) | |
return err | |
} |
The following code does not work:
SetUserSetting(1, "key", "value") // sets the setting to "value" and adds it to the cache
SetUserSetting(1, "key", "updated value") // does nothing because the cache already has the value and the update is skipped
Setting a value should always invalidate/update the cache and the cache should not prevent the update.
Metadata
Metadata
Assignees
Labels
issue/regressionIndicates a previously functioning feature or behavior that has broken or regressed after a changeIndicates a previously functioning feature or behavior that has broken or regressed after a changetype/bug