Skip to content

Can't set user setting multiple times #22537

Closed
@KN4CK3R

Description

@KN4CK3R

Regression of #22295

// 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.

@lunny

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/regressionIndicates a previously functioning feature or behavior that has broken or regressed after a changetype/bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions