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

randomly reorder "latest from follows" each day. #2

Closed
wants to merge 2 commits into from

Conversation

MaxBittker
Copy link

I love the "latest from follows" feed. It reminds me to reach out to friends who don't post constantly, feels like an antidote to modern social media.

This is an attempt at improving it, so it shows different content every day.

Caveat:
Testing this was a bit dicey, it seems to work but my VPS was struggling to keep up with the firehose, and I haven't used gorm before.

There was some behavior (caching maybe?) that I wasn't totally understanding, so a gut check on this code would be appreciated.

I think that this janky prng hash should be enough to keep the feed feeling fresh.

here's a similar "hash" function in desmos:
https://www.desmos.com/calculator/ty7o52ayhh

@MaxBittker
Copy link
Author

I think that this sorting clause is not correct yet

@MaxBittker
Copy link
Author

ok, after fixing a few issues this new hash seems to work! I had to do it without sin because the go sqlite driver seems to not support it, so we're hashing with multiplication and modulus

@MaxBittker
Copy link
Author

I think this would also benefit from another compound index on follows?

@MaxBittker MaxBittker closed this Aug 29, 2023
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.

1 participant