Some settings not getting saved #1250

Open
opened 3 weeks ago by WaduLag · 4 comments

Version information:

Frontend Version: sha256:4aeda57e0037e9f2db56f5706b7232c4252671657e74d35b9aa65feeac121d0f
API Version: sha256:8b707ff1beebc1c8e61c482a6968d10b5132e83f7fa35d066c15388376790b6b
Browser and OS Version: Firefox (104.0.2) & Windows 10 Version 21H2

Steps to reproduce:

  1. Issue 1
    1. Unselect 'Play a sound when marking tasks as done' and press the save button
    2. Logout
    3. Login
    4. 'Play a sound when marking tasks as done' is set back to default
  2. Issue 2
    1. Select 'Color Scheme' and press the save button
    2. Logout
    3. Restart project
    4. Login
    5. 'Color Scheme' is set back to default
      ...

Expected behavior:
'Color Scheme' and 'Play a sound when marking tasks as done' should be saved

Actual behavior:
'Color Scheme' and 'Play a sound when marking tasks as done' are not saved

How to fix it:
Missing columns in the users table and user_settings.go does not set 'Color Scheme' and 'Play a sound when marking tasks as done'. There might be more settings which are not getting set, I only did notice it on these both.

Checklist:

  • I have provided all required information
  • I am using the latest release or the latest unstable build
  • I was able to reproduce the bug on try
**Version information:** Frontend Version: sha256:4aeda57e0037e9f2db56f5706b7232c4252671657e74d35b9aa65feeac121d0f API Version: sha256:8b707ff1beebc1c8e61c482a6968d10b5132e83f7fa35d066c15388376790b6b Browser and OS Version: Firefox (104.0.2) & Windows 10 Version 21H2 **Steps to reproduce:** 1. Issue 1 1. Unselect 'Play a sound when marking tasks as done' and press the save button 2. Logout 3. Login 4. 'Play a sound when marking tasks as done' is set back to default 2. Issue 2 1. Select 'Color Scheme' and press the save button 2. Logout 3. Restart project 4. Login 5. 'Color Scheme' is set back to default ... **Expected behavior:** 'Color Scheme' and 'Play a sound when marking tasks as done' should be saved **Actual behavior:** 'Color Scheme' and 'Play a sound when marking tasks as done' are not saved **How to fix it:** Missing columns in the users table and [user_settings.go](https://kolaente.dev/vikunja/api/src/branch/main/pkg/routes/api/v1/user_settings.go) does not set 'Color Scheme' and 'Play a sound when marking tasks as done'. There might be more settings which are not getting set, I only did notice it on these both. **Checklist:** * [x] I have provided all required information * [x] I am using the latest release or the latest unstable build * [x] I was able to reproduce the bug on [try](https://try.vikunja.io)

The settings were saved in localStorage.
Since https://kolaente.dev/vikunja/frontend/commit/51ffe93 they get cleared when you log out since they leaked between users.

Related: vikunja/frontend#2247

As you point out this should be saved in the database.

@konrad:
Not sure if we should add a new column for every simple user setting.
Wouldn't it make more sense to have a field that contains a json to join simple settings? Else we need to adjust api / tables for every small persistent setting.

The settings were saved in localStorage. Since https://kolaente.dev/vikunja/frontend/commit/51ffe93 they get cleared when you log out since they leaked between users. Related: https://kolaente.dev/vikunja/frontend/issues/2247 As you point out this should be saved in the database. @konrad: Not sure if we should add a new column for every simple user setting. Wouldn't it make more sense to have a field that contains a json to join simple settings? Else we need to adjust api / tables for every small persistent setting.
Poster

I see... thanks for the information. I guess I will search for a work around until they found a fitting solution for the issue.

I see... thanks for the information. I guess I will search for a work around until they found a fitting solution for the issue.

@WaduLag:
If you are using the app alone on your computer you can check 'Stay logged in' in order to prevent logout and deletion of the localStorage cache.

@WaduLag: If you are using the app alone on your computer you can check 'Stay logged in' in order to prevent logout and deletion of the `localStorage` cache.
Owner

Not sure if we should add a new column for every simple user setting.
Wouldn't it make more sense to have a field that contains a json to join simple settings? Else we need to adjust api / tables for every small persistent setting.

Yes. I think we should add a json field to the db for all settings that are exclusive for the frontend.

> Not sure if we should add a new column for every simple user setting. Wouldn't it make more sense to have a field that contains a json to join simple settings? Else we need to adjust api / tables for every small persistent setting. Yes. I think we should add a json field to the db for all settings that are exclusive for the frontend.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: vikunja/api#1250
Loading…
There is no content yet.