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

Per-user search history #7588

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

Per-user search history #7588

wants to merge 4 commits into from

Conversation

mozzius
Copy link
Member

@mozzius mozzius commented Jan 26, 2025

Refactors the search history to partition the history by DID, so that history is unique to the logged-in account

I also changed it to use react-query, since that's better for handling async state the new MMKV storage!

Test plan

Generate some search history
Switch to and from accounts to confirm it's partitioned

Copy link

github-actions bot commented Jan 26, 2025

Old size New size Diff
6.99 MB 6.99 MB 22 B (0.00%)

@macrouch
Copy link

I just realized that Bluesky was on github and came to look into adding this exact feature. So happy to see a PR open already!

Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

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

Nice, love this! Couple thoughts while we're at it:

  • I'd like to avoid random strings for storage and converge around using #/storage interface if possible, lmk what you think of that, can chat in Slack
  • The #/storage interface is sync, which doesn't help here much, but makes stuff a little simpler
  • Could pry pull this out into a hook just for code clarity, can live in this file for now

@estrattonbailey estrattonbailey self-assigned this Feb 3, 2025
@mozzius mozzius force-pushed the samuel/per-user-search-history branch from 9bd94a5 to 7d3ffe3 Compare February 3, 2025 20:42
@arcalinea arcalinea temporarily deployed to samuel/per-user-search-history - social-app PR #7588 February 3, 2025 22:06 — with Render Destroyed
@arcalinea arcalinea temporarily deployed to samuel/per-user-search-history - social-app PR #7588 February 3, 2025 22:18 — with Render Destroyed
@arcalinea arcalinea temporarily deployed to samuel/per-user-search-history - social-app PR #7588 February 3, 2025 22:19 — with Render Destroyed
Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

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

Nice, works great, love the new utils

@@ -90,6 +97,7 @@ export function useProfilesQuery({handles}: {handles: string[]}) {
const res = await agent.getProfiles({actors: handles})
return res.data
},
placeholderData: maintainData ? keepPreviousData : undefined,
Copy link
Member

Choose a reason for hiding this comment

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

Oh didn't know they had a helper, v nice

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.

4 participants