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: persistent memories #8330

Merged
merged 2 commits into from Apr 2, 2024
Merged

feat: persistent memories #8330

merged 2 commits into from Apr 2, 2024

Conversation

jrasm91
Copy link
Contributor

@jrasm91 jrasm91 commented Mar 28, 2024

Dedicated endpoint, service, repository, and database entity for memories, with the goal to make it possible to share, save, and view in the future.

  • create a new memory
  • update an existing memory (mark is as saved, seenAt)
  • delete a memory
  • add assets to a memory
  • remove assets from a memory

Other thoughts:

  • it seems like we need a way to sort them, so there is a memoryAt date field to track the "date" the memory represents. Memories are sorted descending by default so newest memories appear first
  • need to add a way to filter memories so "memory lane" is a cross section for the current time period
  • need to add a job to auto generate memories based on the current query (and potentially expand this in the future)
  • need to update the UI to all the user to "save" or "discard" a memory ( soft? delete)
  • need to add a job to automatically delete memories after X days.

Copy link

cloudflare-pages bot commented Mar 28, 2024

Deploying immich with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9adb005
Status: ✅  Deploy successful!
Preview URL: https://f7252345.immich.pages.dev
Branch Preview URL: https://feat-memory-endpoints.immich.pages.dev

View logs

@jrasm91 jrasm91 force-pushed the feat/memory-endpoints branch 2 times, most recently from 70aa3f1 to 6b6c71a Compare March 28, 2024 18:24
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.

Nice job! :)

e2e/src/api/specs/memory.e2e-spec.ts Outdated Show resolved Hide resolved
server/src/services/memory.service.spec.ts Show resolved Hide resolved
server/src/services/memory.service.spec.ts Outdated Show resolved Hide resolved
server/src/services/memory.service.spec.ts Outdated Show resolved Hide resolved
@jrasm91 jrasm91 requested a review from mertalev March 29, 2024 03:21
server/src/dtos/memory.dto.ts Show resolved Hide resolved
Comment on lines +60 to +62
/** when the user last viewed the memory */
@Column({ type: 'timestamptz', nullable: true })
seenAt?: Date;
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want these memories to be shared, do we want this to be handled at a user level?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These are only going to be tracked for the owner. I'm not sure what functions shared users will be able to do besides view them in the future. Eventually we could do something like we have planned to do with assets and move owner id off of this table, but it seems premature to try to figure that out now, here.

Comment on lines +52 to +54
/** unless set to true, will be automatically deleted in the future */
@Column({ default: false })
isSaved!: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly, do we want to store who it's saved by?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm planning on having this work like Google. So, we'll generate memories and unless the user clicks something to "save" it (set this to true) it will get automatically deleted after 14 days.

@alextran1502
Copy link
Contributor

Do we address #8352 in this PR?

@jrasm91
Copy link
Contributor Author

jrasm91 commented Mar 29, 2024

Do we address #8352 in this PR?

No. This PR adds the foundation to support persistent memories (adds a new API for them) but it doesn't include automatic memory generation yet. I was planning to do that part in a follow-up pull request.

@alextran1502
Copy link
Contributor

Let's resolve the conflicts and merge it!

@jrasm91 jrasm91 merged commit cd0e537 into main Apr 2, 2024
24 checks passed
@jrasm91 jrasm91 deleted the feat/memory-endpoints branch April 2, 2024 14:23
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.

None yet

4 participants