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

Make subscription and filter cookies split into multiple cookies if they're too large #288

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ButteredCats
Copy link
Contributor

@ButteredCats ButteredCats commented Oct 12, 2024

Basically the title. This would fix #279. Also fixes a problem of empty cookies not being deleted.

This branch currently has subscriptions and filters split into subscriptions, subscriptions1, filters, filters1, etc.

Still left to figure out:

  • How to deal with old subscriptions and filters cookies?
    • Made it start with existing cookie names and then count up from there Currently this only works if you don't have any old cookies. They still function, and if you change anything you'll get the new cookies with correct values. The problem is the old cookies stay and don't get updated. Would it be better to make this new system start with subscriptions and then the next cookie would be subscriptions1 in order to not break things? I started on it but it seemed like it was going to add more complexity than the next solution. Or would it be better to just convert to the new system and delete the old subscriptions cookie if it exists? Seems like code that's eventually useless if we went that direction.
  • Can the size checking in join_until_size_limit() be made smarter?
    • Reddit only allows "normal" characters so we won't have any characters larger than a byte, so this is fine. Characters with accents like ã are more than one byte, but this only checks the length of the string. Are special characters even allowed in subreddit/user names?
  • Make restoring cookies function with the new system. Currently doesn't override any existing numbered subscription or filter cookies.

@ButteredCats ButteredCats marked this pull request as draft October 12, 2024 02:58
@ButteredCats ButteredCats marked this pull request as ready for review October 13, 2024 15:30
@ButteredCats
Copy link
Contributor Author

Alright! As far as I can tell everything is working and I've handled all the situations I can think of.

I'm sure there are things that can be cleaned up and written better, and I strongly encourage more people to test it, but it does work and you can have a theoretically infinite amount of subscriptions or filters.

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.

🐛 Bug Report: Limit on subscribed subreddits
1 participant