Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update reader or preferences settings #2937

Open
Anzumatsuri opened this issue May 5, 2024 · 13 comments
Open

Unable to update reader or preferences settings #2937

Anzumatsuri opened this issue May 5, 2024 · 13 comments
Labels
needs-triage Needs to be triaged by a developer and assigned a release

Comments

@Anzumatsuri
Copy link

Anzumatsuri commented May 5, 2024

What happened?

Reader Settings

This issue occurs 100% of the time for me.

  1. Open any manga or book
  2. In reader, expand settings
  3. Under Layout Mode, by default its set to Single
  4. Set it to Double or Double (Manga)
  5. Click Save Globally
  6. Nothing happens. No toast notification on the bottom right notifying that it has been saved
  7. Changing back to Single and save works fine.

Upon checking the dev tools, the /api/users/update-preferences returned 400 Bad Request. The return response below:

{
    "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
    "title": "One or more validation errors occurred.",
    "status": 400,
    "errors": {
        "preferencesDto": [
            "The preferencesDto field is required."
        ],
        "$.pageSplitOption": [
            "The JSON value could not be converted to API.Entities.Enums.PageSplitOption. Path: $.pageSplitOption | LineNumber: 0 | BytePositionInLine: 62."
        ]
    },
    "traceId": "00-c978ce553fad21f4132d767cc970c913-04a27573ba8b8052-00"
}

If its updated in User settings > Preference > Image Reader, it can be updated successfully.

Preferences Settings

This is quite hard to reproduce. It does not occur 100% of the time.

  1. Open User Settings
  2. Select the preference tab
  3. Under Global Settings, even though my Locale was set to English, sometimes it would load as "Chinese (Simplified)". It won't appear most of the time, but it is reproducible if I spam refresh till it appears.

If It loads as "Chinese (Simplified)":

  1. The Locale dropdown list cannot be expanded.
  2. Update any settings in preferences, click save.
  3. Nothing happens. No toast notification on the bottom right notifying that it has been updated.

Checking the dev tools again, the /api/users/update-preferences returned 400 Bad Request as well. The return response below:

{
    "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
    "title": "One or more validation errors occurred.",
    "status": 400,
    "errors": {
        "Locale": [
            "The Locale field is required."
        ]
    },
    "traceId": "00-cd52d0f54f6d63f0440033ad6ccb7cb3-8478fab545badeaa-00"
}

What did you expect?

Both settings to be saved successfully.

Kavita Version Number - If you don not see your version number listed, please update Kavita and see if your issue still persists.

0.8.1 - Stable

What operating system is Kavita being hosted from?

Docker (Dockerhub Container)

If the issue is being seen on Desktop, what OS are you running where you see the issue?

Windows

If the issue is being seen in the UI, what browsers are you seeing the problem on?

Firefox, Chrome, Microsoft Edge

If the issue is being seen on Mobile, what OS are you running where you see the issue?

iOS 17.4.1

If the issue is being seen on the Mobile UI, what browsers are you seeing the problem on?

Safari, Chrome

Relevant log output

No response

Additional Notes

  • Running Kavita on Synology NAS DS1520+
  • Kavita is front by Cloudflare, but issue is occurring on http://LAN_IP:33400 as well
  • Been using since version 0.5.1.1 but I don't remember the issue coming up back then. I first noticed it on version 0.7.9.0.
  • I have reported the preference settings issue on Discord previously when I was on version 0.7.10.2. A small check was added to the Locale in 0.7.13 but it did not fixed the issue.
  • I have tried wiping the docker volumes and start from scratch, even for version 0.8.1. It did not do anything.
@Anzumatsuri Anzumatsuri added the needs-triage Needs to be triaged by a developer and assigned a release label May 5, 2024
@DieselTech
Copy link
Collaborator

If It loads as "Chinese (Simplified)":

We've seen this in the past, but it hasn't been reported by users in quite some time. If you run the Bust Locale Cache in the admin panel tasks pages can you see if that resets the Locale?

@Anzumatsuri
Copy link
Author

Anzumatsuri commented May 5, 2024

If It loads as "Chinese (Simplified)":

We've seen this in the past, but it hasn't been reported by users in quite some time. If you run the Bust Locale Cache in the admin panel tasks pages can you see if that resets the Locale?

Hmm it doesn't prompt any toast notification whatsoever when I clicked the button, but upon checking the logs it seems like it indeed ran successfully:

image

But sadly the locale issue still occurs. ☹️
It appeared immediately when I navigate to the preference settings page right after. I refreshed once and it did not appear again.
Though for the 2nd time it appears it took quite a number of refreshes. Pretty much literally spamming F5 till it changes to "Chinese (Simplified)."

@majora2007
Copy link
Member

Can you try logging out of Kavita and back in?

@Anzumatsuri
Copy link
Author

Can you try logging out of Kavita and back in?

I ran Bust Locale Cache again and relog but still no luck. Locale still loads as Chinese (Simplified).

@majora2007
Copy link
Member

Sorry I should have clarified. What I'm trying to see is if you log out then back in again, if you are able to change the Locale and thus any other preferences, as that was your original issue.

To my knowledge, this bug crops up from older installs upgrading, where something goes haywire and data on the client doesn't align with what's in the backend (aka locale is missing). I would also ask to clear your browser cache to ensure 100% an older version of UI code isn't playing a part here.

@Anzumatsuri
Copy link
Author

Anzumatsuri commented May 6, 2024

Ah okay. My bad I should have explained it clearly as well.

When I mentioned that it loads as Chinese (Simplified) it doesn't really means that it immediately loads as that. Most of the time the Locale loads correct in English but at times it just loads as Chinese (Simplified).

Spamming F5 to refresh was the only way for me to see if the issue still persist as on some refresh it'll randomly loads as Chinese (Simplified).

Back to your suggestion, before logging out I went to the preference page for a peek and this time it immediately loads as Chinese (Simplified). After relogging it loads correctly as English. Though spamming refresh still loads Chinese (Simplified) on some refreshes.

Locale issue aside, what about the Layout Mode issue?

@majora2007
Copy link
Member

These 2 issues are related because your locale isn't being set correctly, meaning that when you go to save the preferences, it's not fully constructed. It might be something with your db, but to keep things simple, can you first fill out the user preferences by touching (selecting something else, then back to the original) every control on that page and hitting save?

This should ensure everything gets set in the payload. Normally this shouldn't be an issue, but I bet you have some invalid data in one field and thus this issue is blocking you.

@Anzumatsuri
Copy link
Author

Anzumatsuri commented May 6, 2024

Okay I have flipped every single dropdown list and switches 1 by 1 and save after each change. Nope its still broke on some refreshes.

@majora2007
Copy link
Member

Wait when you saved, were you able to persist the settings like you reported with the layout mode?

@Anzumatsuri
Copy link
Author

Anzumatsuri commented May 6, 2024

Yes the layout mode can be saved in user settings preference page. The error only occurs in the book/manga reader when I choose Double or Double (Manga).

image

Even if the default was set to one of the two in the user settings, the only setting that can be saved in the reader is setting it to Single.

Update:
Looks like the locale issue came up on mobile as well. Running iOS 17.4.1, it appeared on both Safari and Chrome.

@majora2007 majora2007 added this to To do in v0.8 - PDF & Comic Love via automation May 9, 2024
@majora2007 majora2007 added support User is needing support on something not working but not confirmed to be a bug and removed support User is needing support on something not working but not confirmed to be a bug labels May 9, 2024
@Anzumatsuri
Copy link
Author

Anzumatsuri commented May 20, 2024

I've noticed the a difference between saving the layout mode in reader vs in preference page.
Below are the the request payload for saving the layout mode in both pages.

In Reader Settings:

{
  "readingDirection": 0,
  "scalingOption": 3,
  "pageSplitOption": null,              // This value will be null if "layoutMode" is set to 2 or 3
  "readerMode": 0,
  "layoutMode": 2,                        //  1 for Single, 2 for Double, 3 for Double (Manga)
  "emulateBook": false,
  "backgroundColor": "#000000",
  "swipeToPaginate": false,
  "autoCloseMenu": true,
  "showScreenHints": true,
  "bookReaderMargin": 15,
  "bookReaderLineSpacing": 100,
  "bookReaderFontSize": 100,
  "bookReaderFontFamily": "default",
  "bookReaderTapToPaginate": false,
  "bookReaderReadingDirection": 0,
  "bookReaderWritingStyle": 0,
  "theme": {
    "id": 1,
    "name": "Dark",
    "normalizedName": "dark",
    "fileName": "dark.scss",
    "isDefault": true,
    "provider": 1,
    "created": "2024-05-01T13:09:37.3565967",
    "lastModified": "2024-05-01T13:09:37.3563742",
    "createdUtc": "2024-05-01T05:09:37.3566615",
    "lastModifiedUtc": "2024-05-01T05:09:37.3564947"
  },
  "bookReaderThemeName": "Dark",
  "bookReaderLayoutMode": 0,
  "bookReaderImmersiveMode": false,
  "globalPageLayoutMode": 0,
  "blurUnreadSummaries": false,
  "promptForDownloadSize": true,
  "noTransitions": false,
  "collapseSeriesRelationships": true,
  "shareReviews": false,
  "locale": "en",
  "pdfTheme": 0,
  "pdfScrollMode": 0,
  "pdfLayoutMode": 0,
  "pdfSpreadMode": 0
}

In Preference Page:

{
  "readingDirection": 0,
  "scalingOption": 3,
  "pageSplitOption": 3,                  // This value isn't null, able to save all 3 layout modes
  "autoCloseMenu": true,
  "readerMode": 0,
  "layoutMode": 3,                        //  1 for Single, 2 for Double, 3 for Double (Manga)
  "showScreenHints": true,
  "backgroundColor": "#000000",
  "bookReaderFontFamily": "default",
  "bookReaderLineSpacing": 100,
  "bookReaderFontSize": 100,
  "bookReaderMargin": 15,
  "bookReaderTapToPaginate": false,
  "bookReaderReadingDirection": 0,
  "bookReaderWritingStyle": 0,
  "bookReaderLayoutMode": 0,
  "bookReaderThemeName": "Dark",
  "theme": {
    "id": 1,
    "name": "Dark",
    "normalizedName": "dark",
    "fileName": "dark.scss",
    "isDefault": true,
    "provider": 1,
    "created": "2024-05-01T13:09:37.3565967",
    "lastModified": "2024-05-01T13:09:37.3563742",
    "createdUtc": "2024-05-01T05:09:37.3566615",
    "lastModifiedUtc": "2024-05-01T05:09:37.3564947"
  },
  "bookReaderImmersiveMode": false,
  "globalPageLayoutMode": 0,
  "blurUnreadSummaries": false,
  "promptForDownloadSize": true,
  "noTransitions": false,
  "emulateBook": false,
  "swipeToPaginate": false,
  "collapseSeriesRelationships": true,
  "shareReviews": false,
  "locale": "en",
  "pdfTheme": 0,
  "pdfScrollMode": 0,
  "pdfSpreadMode": 0
}

@Benjamin-Watson0
Copy link

Benjamin-Watson0 commented May 20, 2024

If you first configure your library in English and then switch to Chinese after the initial installation, you will encounter this problem. This is my guess because I also encountered this problem.
@Anzumatsuri

@Anzumatsuri
Copy link
Author

If you first configure your library in English and then switch to Chinese after the initial installation, you will encounter this problem. This is my guess because I also encountered this problem. @Anzumatsuri

Nope, it was set to English from the start I did not change it even after a fresh reinstall.

I went and switched to another language (French) and see if the issue still occurs after a few refresh, but so far it did not appear yet. I'll update again if it does.

I did noticed that some languages do not have any text values for the buttons, I'm not sure if its only occurring on my end.

image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs to be triaged by a developer and assigned a release
Projects
Development

No branches or pull requests

4 participants