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

Fix crash 0.37 due to missing SortTypes #918

Merged
merged 6 commits into from
Jul 1, 2023
Merged

Conversation

MV-GH
Copy link
Collaborator

@MV-GH MV-GH commented Jun 29, 2023

Fixes the crash due to missing sortTypes, added the ones that were added in 0.18.
Refactor the sorttypes stuff, it was kept in different lists all over the place, kept centrally now. Had to look everywhere to find random bits of sortType logic. Yeah sorry twizmazin about not putting this in a seperate PR but i was not going to write a bunch of duplicate code to remove it in the next pr.

When setting the value to TopThreeMonths or TopSixMonths or TopNineMonths. It causes a query error. It does not cause a crash but no posts load in anymore until you change it. I believe this is actually rather a backend issue. Maybe months did get added a different version?

Query deserialize error: unknown variant `TopNineMonths`, expected one of `Active`, `Hot`, `New`, `Old`, `TopDay`, `TopWeek`, `TopMonth`, `TopYear`, `TopAll`, `MostComments`, `NewComments`, `TopHour`, `TopSixHour`, `TopTwelveHour`

Fixes #911

EDIT:

It seems these months ones weren't added yet. I have commented them for easy restoration for when they do get added. But that means they must be added again BEFORE they get released.

EDIT2:
I recommend actually keeping them as they get added in 18.1 and it causes no harm right now. It will only make it so that it will revert when set in the usersettings page. Or no posts will load in when set to one of these types

SortType.TopYear,
SortType.TopAll,
)
val topSortTypes = SortType.values().filter { it.name.startsWith("Top") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spose this is okay, although hard-coding them makes it much more clear.

@dessalines dessalines enabled auto-merge (squash) June 29, 2023 21:10
@dessalines dessalines merged commit 59cde9a into LemmyNet:main Jul 1, 2023
@MV-GH MV-GH deleted the bug/911 branch July 1, 2023 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jerboa crashing immediately after update to 0.0.37
2 participants