Photo attachments on forums #6

Closed
opened 2022-09-18 21:30:45 +00:00 by noah · 1 comment

Just some notes and feature planning on this.

Some high level considerations:

  • Expiration and disk space: unlike profile photos, forum photos won't be limited in quantity but may be limited in time with an ability to expire and delete old photos (from months or years ago) as needed to reclaim space.
    • The feature to reclaim space might not be implemented to begin with - we can probably get mileage for months/years before this really becomes a concern, but the ability for forum images to expire should be accounted for.
  • Orphaned photos: the workflow would probably involve uploading a picture before you've created the post that goes with it, with the possibility that the post is abandoned before creation and orphaned photos would need to be cleaned up or they just leak disk space usage.

Some open questions:

  • Just one photo per post, or multiples?

Some database design ideas:

  • Add a CommentPhoto table to associate pictures to forum posts (forum posts are kinds of Comments)
    • Columns including a CommentID, Filename, Filesize, dates/times.
    • Ability to have a null CommentID - to be populated when the forum post is created. Orphaned pictures would be ones with a null CommentID and a CreatedAt older than a reasonable threshold (24 hours?)
    • Have an ExpiredAt column to handle cleanup? so if old photos are deleted we set ExpiredAt but still retain the DB column, so posts referencing expired photos can show a nice UI instead of having a broken image link.

UX and workflow:

  • When creating or replying to a forum thread have a field to browse and attach a picture.
    • Probably only on the dedicated edit page, not the in-line reply box on the footer of threads.
    • Creates a CommentPhoto row and returns its ID so it can be linked to the created comment later.
  • When editing a post that has a linked photo: show some UI to list and option to remove the photo. Removing it would immediately delete the image from the server hard disk along with removing the CommentPhoto database row.
  • User account deletion: all of your forums and comments are deleted already so any linked CommentPhoto would be removed as well.
Just some notes and feature planning on this. Some high level considerations: * Expiration and disk space: unlike profile photos, forum photos won't be limited in _quantity_ but may be limited in _time_ with an ability to expire and delete old photos (from months or years ago) as needed to reclaim space. * The feature to reclaim space might not be implemented to begin with - we can probably get mileage for months/years before this really becomes a concern, but the ability for forum images to expire should be accounted for. * Orphaned photos: the workflow would probably involve uploading a picture before you've created the post that goes with it, with the possibility that the post is abandoned before creation and orphaned photos would need to be cleaned up or they just leak disk space usage. Some open questions: * Just one photo per post, or multiples? Some database design ideas: * Add a CommentPhoto table to associate pictures to forum posts (forum posts are kinds of Comments) * Columns including a CommentID, Filename, Filesize, dates/times. * Ability to have a null CommentID - to be populated when the forum post is created. Orphaned pictures would be ones with a null CommentID and a CreatedAt older than a reasonable threshold (24 hours?) * Have an ExpiredAt column to handle cleanup? so if old photos are deleted we set ExpiredAt but still retain the DB column, so posts referencing expired photos can show a nice UI instead of having a broken image link. UX and workflow: * When creating or replying to a forum thread have a field to browse and attach a picture. * Probably only on the dedicated edit page, not the in-line reply box on the footer of threads. * Creates a CommentPhoto row and returns its ID so it can be linked to the created comment later. * When editing a post that has a linked photo: show some UI to list and option to remove the photo. Removing it would immediately delete the image from the server hard disk along with removing the CommentPhoto database row. * User account deletion: all of your forums and comments are deleted already so any linked CommentPhoto would be removed as well.
noah added the
enhancement
label 2022-09-18 21:30:45 +00:00
Poster
Owner

Implemented in 47f898561c

Implemented in https://code.nonshy.com/nonshy/website/commit/47f898561c1a69d431a1cae6dfb6466660561e91
noah closed this issue 2022-10-21 05:27:39 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nonshy/website#6
There is no content yet.