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

feat(server): user metadata #9650

Merged
merged 6 commits into from
May 22, 2024
Merged

feat(server): user metadata #9650

merged 6 commits into from
May 22, 2024

Conversation

jrasm91
Copy link
Contributor

@jrasm91 jrasm91 commented May 21, 2024

Add support for user preferences via a generic user key/value store. User preferences without dedicated database columns makes it significantly easier to add settings, features, and preferences that should be stored per user. Maybe of the user settings in the web application are stored client-side, but could be migrated here in the future.

Additionally, the generic key/value store per user may come into play with plugins, who could get access to per user persistance/settings via this table as well.

Preferences included in this PR:

  • avatar color
  • memories enabled

Preferences to be added in the future:

  • notification settings for emails
  • dedicated people tab

Copy link

cloudflare-workers-and-pages bot commented May 21, 2024

Deploying immich with  Cloudflare Pages  Cloudflare Pages

Latest commit: 866366b
Status: ✅  Deploy successful!
Preview URL: https://b7dd8464.immich.pages.dev
Branch Preview URL: https://feat-user-preferences.immich.pages.dev

View logs

@jrasm91 jrasm91 force-pushed the feat/user-preferences branch from fbd1e85 to 1509b1e Compare May 21, 2024 17:25
@jrasm91 jrasm91 force-pushed the feat/user-preferences branch from 1509b1e to 3af2ad3 Compare May 21, 2024 21:41
Copy link
Member

@danieldietzler danieldietzler left a comment

Choose a reason for hiding this comment

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

Looking at the sql files, I think we want to join metadata in all those queries, right?

key: UserMetadataKey.PREFERENCES,
value: { memories: { enabled: false } },
});
delete dto.memoriesEnabled;
Copy link
Member

Choose a reason for hiding this comment

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

Why do you delete it from the dto?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So it doesn't get passed to the database

server/test/fixtures/user.stub.ts Outdated Show resolved Hide resolved
@jrasm91 jrasm91 force-pushed the feat/user-preferences branch from 8edfc67 to 72f8df3 Compare May 22, 2024 02:25
@jrasm91 jrasm91 marked this pull request as ready for review May 22, 2024 02:43
@jrasm91 jrasm91 requested a review from zackpollard May 22, 2024 02:43
Copy link
Contributor

@zackpollard zackpollard left a comment

Choose a reason for hiding this comment

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

LGTM overall

@jrasm91 jrasm91 merged commit 06ce824 into main May 22, 2024
24 checks passed
@jrasm91 jrasm91 deleted the feat/user-preferences branch May 22, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants