Skip to content

Add Auto Archiving of Creatures#390

Open
LinuxUser393 wants to merge 15 commits into
ThaumRystra:developfrom
LinuxUser393:develop
Open

Add Auto Archiving of Creatures#390
LinuxUser393 wants to merge 15 commits into
ThaumRystra:developfrom
LinuxUser393:develop

Conversation

@LinuxUser393
Copy link
Copy Markdown

Created a server cron job to check every 10 minutes for any creatures/characters that were updated more than archiveAfterDays ago and archive it, according to the "lastComputedAt" value on the creature. archiveAfterDays can be set in the meteor settings file or meteor settings environmental variable.

Tested using the docker compose file with build caching disabled and archiveAfterDays both set and unset.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 28, 2025

CLA assistant check
All committers have signed the CLA.

@Themayu
Copy link
Copy Markdown

Themayu commented Mar 28, 2025

I feel like you didn't intend to commit the changes made to the Dockerfile.

Also: Creatures archived this way should stay accessible via the character list, so as to not look like they were just deleted without warning. Dicecloud should automatically unarchive them on access.

@LinuxUser393
Copy link
Copy Markdown
Author

Thanks for catching the Dockerfile. I had originally thought that this could give more time to get the hosting issues sorted out, but you do have a good point that it should be a more complete feature before it is merged.

@LinuxUser393 LinuxUser393 marked this pull request as draft March 28, 2025 18:46
@Themayu
Copy link
Copy Markdown

Themayu commented Mar 28, 2025

It's more that it is never a good look for user data to be deleted, or to appear to have been deleted, without warning. It makes for a bad experience, especially on a service where you can sometimes expect to not touch a particular character sheet for a while.

An example: I haven't touched one in months because it's used in a play-by-post that has stalled because of my memory. Despite this, I would be very upset if the character sheet suddenly disappeared from my list one day, as I still plan on continuing the PBP when my mental health stabilises. Regardless of what actually happened, it would appear as though the sheet has been deleted for inactivity, and that would be a bad experience for me.

@LinuxUser393
Copy link
Copy Markdown
Author

I have been thinking about how to show to the user that the archived characters aren't gone and I have come up with four ideas that I would like to hear your opinion on. I am currently leaning towards option 3, as I don't think it would be too difficult to implement.

  1. Auto archiving creates an "archived character" creature.

    • Seamless auto archiving.
    • Auto restores on launch.
    • Duplicates creature entry, one in character list, one in archived character list.
    • Might make Dicecloud seem slow when loading an archived character for the first time.
    • Least communication to the user about what is happening in the background.
  2. Integrate archived characters into the characters list.

    • Sort active characters and folders containing active characters first.
    • Archived characters will be more gray than active characters.
    • "Restore" or "Restore from Archive" button on right, just left of the 3x4 dot array.
    • Launching shows dialog asking if you want to restore the creature.
  3. Add archived characters to a second category on the characters page.

    • "Restore" or "Restore from Archive" button on right, just left of the 3x4 dot array.
    • Launching shows dialog asking if you want to restore the creature.
  4. Add notification that some characters were automatically archived.

    • Easiest to implement.
    • Easiest to miss.

Options 2 and 3 could be applied to auto archived characters or all archived characters. I think applying all archived characters would be best as it doesn't make auto archived characters special, and users may be more likely to archive characters themselves.

…es when the "singleCharacter" publication is subscribed to and the target creature was automatically archived.

Automatically archiving creatures now leaves the entry in the creature database, setting the archiveId property. Updated archive deleting to check for and delete the corresponding creature entry. Updated manual creature archiving to check if the creature was auto archived, delete the creature entry, and remove the auto flag from the archive. The files page shows auto archives with a label saying such, and shows an open button instead of a restore button.
Fixed issue where updating the file storage used would fail due to a server side error.
@LinuxUser393
Copy link
Copy Markdown
Author

Ended up going with option 1, as while I was working on option 3, then 2, I realized that I was writing a lot of duplicate code and this keeps most of the changes on the server.

Automatically created archives now leave the document in the "creatures" collection, set the archiveId property of the document to the id of the created archive, and set the "meta.auto" property of the created archive to true. The "singleCharacter" publication checks to see if the requested creature has the archiveId property set, and restores the archive if found. This makes the archived creature count against the character count, and allows anyone who has viewing permission to restore the creature. Automatic archives count against the file storage limit, and are shown in the files page with a subtitle saying such and an open button instead of a restore button. Automatic archives can be manually archived to remove them from the creature list and disable viewing permissions.

@LinuxUser393 LinuxUser393 marked this pull request as ready for review April 28, 2025 18:00
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.

3 participants