Closed wildskyf closed 5 years ago
I would like to see it autoclear at the end of every session, assuming the end-of-session was not caused by the browser crashing.
@Gitoffthelawn I have opened #21 for it though I don't know whether API is okay to implement that feature. Thank you. :)
Thank you!
By the proposed, "autoclear after a few days or weeks in option page," do you mean autoclear (only) entries older than n days?
Another suggestion: as of v2.3 there's still no way to select multiple entries at once in the drop list to delete them.
AFAIK, only one entry can be selected - to show in TACL's display, before you can delete it.
That's fine for 1 or 2 entries. Very tedious for 10+, deleting one at a time. That's assuming user doesn't want to "delete all cache."
I'm not sure how hard it'd be to add the option to select a continuous block of entries (e.g., Shift + click), or to select several non-adjacent entries (e.g., Ctrl + click - random entries), then delete selected items at once.
An "autoclear entries that are n days old" would take care of some, but not all of my suggestion.
I can see users wanting to delete multiple, specific entries - before they reach a specified "auto-clear after n days." Say, for medical or legal correspondence. HTH.
@bendover22, I have added a new issue #45, and add your comment there. Thanks for your suggestions!
This would be a great addition :) For the time, maybe it can also be configured in hours/minutes, for instance for privacy reasons.
I don't know what the "date API" allows, so I'm not sure what to suggest.
If it will allow entering specific dates, that would be great.
If it only allows entering, "Delete older than last 1 / 2 / 3 weeks", then perhaps, "Delete last 1 / 2 or ... months"
Hopefully something where anything older than n weeks or n months is deleted.
I have no need to store months of entries. (As of now, I can't delete any from the UI).
If entries were that important, I'd store them elsewhere.
The addon isn't really supposed to be long term storage of text entries, is it?
Hi all, I have implement the auto clear feature at version 4.1.1.
By default, auto-clear is set to disable, you could enable this feature in the option page.
I'll take a look at it soon! Thanks!
I took a look at the autoclear functionality. I'm trying to understand it a little better.
Let's say you tell it to autoclear after 5 hours. Does that mean that any items more than 5 hours old are deleted, but newer items are kept (until they are at least 5 hours old)? This would be pretty neat.
Or does it mean that everything is cleared every 5 hours?
Or something else?
Hi @Gitoffthelawn thx for your asking.
AutoClear will remove cache, which is saved for a certain time.
For example, here are 3 caches, they were saved A) 10 min ago B) 10 day ago C) 10 month ago
if you set the auto clear time to 1 min, they will be all clear when the checker are triggered. if you set the auto clear time to 50 day, cache B & C will be removed, but A will not. (but it will be removed when its saved time become 50day ago.)
Thanks @wildskyf !
That sounds great.
I think there is one mistake in the example. It says: "if you set the auto clear time to 50 day, cache B & C will be removed, but A will not. (but it will be removed when its saved time become 50day ago.)"
I think you meant: "if you set the auto clear time to 50 day, cache C will be removed, but A and B will not. (but they will be removed when their saved times become 50day ago.)"
Does that sound right?
Also, when is the checker triggered?
I think you meant: "if you set the auto clear time to 50 day, cache C will be removed, but A and B will not. (but they will be removed when their saved times become 50day ago.)"
YES! That's what I mean! Sorry for the confusion. :)
Checker will be triggered when browser startup and once every minute. Let's see whether there is any performance issue, I think there will not be. (After all, it is recommended implement by official example.)
:-)
If "auto clear old cache" is not checked, is the checker still triggered, or does the check not take place at all?
The checker function will be called, but it will early return when that "auto clear old cache" is not checked.
the code of related checker is at here: https://github.com/wildskyf/TextareaCache/blob/master/ta_bg.js#L220-L247
Thanks for the link to that section of the code. :+1:
Would it be possible to not call the checker at all in that case?
Yes, it's possible, I could add/remove listener as long as user toggle the auto-clear option. But this might cause code more complicating.
I think an early-returned function might not cause expensive performance issue too much, so I prefer observe for a while. If there does be any performance issue, I might consider to change the current state of code.
and, Pull Request Welcome. ;P
Currently, the auto-clear feature is implemented, so this issue could be close.
Thanks to Tim. This might be a good option for users.