cryptgeon icon indicating copy to clipboard operation
cryptgeon copied to clipboard

Expiration for all notes (even view constraint notes)

Open andy-g opened this issue 2 years ago • 7 comments

I've been using https://1ty.me/ but wanted to find a self hosted open source alternative, so was super happy to stumble across your creation today. Thanks so much.

I'm wondering whether it'd be an option to enable expiration for view constrain notes, this will prevent unused notes staying in redis indefinitely, and should be pretty easy to implement with a TTL on the redis key. Generally in my use, I also configure single view notes (so as long as the expected recipient received it I know no-one else has seen it), and I expect someone to pickup the note in the next hour or day etc., so would be nice to be able to configure MAX_EXPIRATION and allow a user to set the expiry for single view notes too.

In essence the combination of Expiration and View count would be very useful.

I don't have much Svelte or rust experience, but would be happy to help out if you feel it's something that'd server the broader use case.

andy-g avatar Nov 24 '22 17:11 andy-g

Yes, I have thought about this as well, makes sense. Maybe the toggle could have like thrid mode in the middle enabling both modes. The current expiration is already using redis TTL (and an additional backend check in case it has not been evicted yet) so the logic mostly is already there.

RN i don't have time to work on this unfortunately, so feel free to contribute, or you'll need some patience ❤️

cupcakearmy avatar Nov 24 '22 20:11 cupcakearmy

This feature would be much appreciated!! Making sure an unseen note also will be deleted in say 7 days.

PittBie avatar Oct 02 '23 12:10 PittBie

If I find the time to work on a PR for this feature, would you have time to review it @cupcakearmy ?

For the UI, I would have replaced the "mode" button, with a checkbox "expire", but I will whatever you prefer, I have no preference on this.

GreeFine avatar Jan 04 '24 12:01 GreeFine

That would be super nice! I kind of still prefer the toggle to have a "both" position would be nice, to allow either expiration, views or both to be possible. If you find a better solution though i don't have hard preference on it either. We can discuss later :)

cupcakearmy avatar Jan 11 '24 18:01 cupcakearmy

@GreeFine also, I appreciate any comment on the rust codebase in general, this was my first rust project, so any improvement / suggestions are welcomed! 😊

cupcakearmy avatar Jan 11 '24 18:01 cupcakearmy

Yes, I have thought about this as well, makes sense. Maybe the toggle could have like thrid mode in the middle enabling both modes. The current expiration is already using redis TTL (and an additional backend check in case it has not been evicted yet) so the logic mostly is already there.

RN i don't have time to work on this unfortunately, so feel free to contribute, or you'll need some patience ❤️

I would even remove the toggler and just leave the two fields : view and time (with a time set to 0 = infinite). Another units than minutes would also be good (maybe a drop list with only few choices like "no time limit", "1h", "1day", "1 week" ?).

microbearlogist avatar May 29 '24 14:05 microbearlogist

I admit there is room for improvement. Both in UX and functionality here.

Probably removing the toggle makes sense. leaving a field empty would just mean no limit.

cupcakearmy avatar May 31 '24 12:05 cupcakearmy