Skip to content

🐛 Bug Report: Default post sort does not apply until settings are saved at least once #501

@Sparronator9999

Description

@Sparronator9999

Describe the bug

When an instance (like my private one) is configured to sort posts (and possibly comments - I didn't test this) by anything other than the default (Hot for subreddit posts), the new setting doesn't take effect until the Settings page is opened and "Save" is clicked at least once (even if none of the settings were changed).

Steps to reproduce the bug

Steps to reproduce the behavior:
0. Configure your Redlib instance to sort posts by anything other than "Hot" (using REDLIB_DEFAULT_POST_SORT in my case), and restart it.

  1. Visit any subreddit through your instance (the default r/popular page is fine).
  2. Notice that posts are sorted by "Hot" instead of your default setting (I use "New" on my instance).
  3. Go to the settings page. Notice the default subreddit post sort is set to your new default.
  4. Click "Save" at the bottom of the page. No need to change any settings.
  5. Go back to the previous page and refresh (to apply settings "changes").

What's the expected behavior?

Subreddit posts will always be sorted by your instance's chosen default setting, even without saving any settings on the client end.

Additional context / screenshot

r/popular in a new browser session (all cookies/cache cleared):

Image

Relevant instance info, after showing the previous page:

Image

Relevant Redlib settings, after showing instance info:

Image
  • I checked that the instance that this was reported on is running the latest git commit, or I can reproduce it locally on the latest git commit

Instance is running commit 2dc6b5f (latest as of writing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions