Add Auto Archiving of Creatures#390
Conversation
…been updated since duration configured in Meteor settings.
…ime to docker-compose.yml, and point Dockerfile at this repo for development.
…chiveCreatureToFile.
…ge the archive threshold to 100 days.
|
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. |
|
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. |
|
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. |
|
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.
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. |
… Fixed redis-oplog submodule.
…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.
|
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. |
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.