Otherwise, threads that were converted from a command to a tickle label by the current execution of the script won't also get restored if it's within the appropriate time window.
This isn't a particularly elegant solution, but minimizes complexity added elsewhere. It does mean the script calls GmailApp.getUserLabels() an extra time on every execution, and also lbl.getThreads() for each label matching TICKLE.label_prefix, but I'm inclined to address performance issues once they occur with the new implementation.
Otherwise, threads that were converted from a command to a tickle label by the current execution of the script won't also get restored if it's within the appropriate time window.
This isn't a particularly elegant solution, but minimizes complexity added elsewhere. It does mean the script calls
GmailApp.getUserLabels()
an extra time on every execution, and alsolbl.getThreads()
for each label matchingTICKLE.label_prefix
, but I'm inclined to address performance issues once they occur with the new implementation.