Page 1 of 1

method of deleting all subscriber messages in one request?

PostPosted: Thu Jun 01, 2023 8:09 am
by JuiceyBrucey
Hi, is there a plugin or other method of deleting all subscriber messages in one request?
I can write a script that will delete them one by one, but it would be much faster if there was one that does it all in one go.
I could write a plugin that will delete them all from the one table, but then the issue of related tables comes in and the possibility of leaving redundant data in the database.
Thankyou. Cheers

Re: method of deleting all subscriber messages in one reques  Topic is solved

PostPosted: Thu Jun 01, 2023 12:39 pm
by Mike.Sheen
The attached plugin adds a new route, /Webhooks/Messages/Retention - which is a DELETE operation.

When invoked, it will delete webhook messages and their responses which are sent or failed permanently, and are older than a configurable retention period.

Re: method of deleting all subscriber messages in one reques

PostPosted: Mon Jun 05, 2023 10:40 am
by JuiceyBrucey
Excellent. Thank you for that.
I tried to import it, but when saving it, I get this error message:
pluginerror1.png
Error message when saving
pluginerror1.png (132.46 KiB) Viewed 2499 times

Re: method of deleting all subscriber messages in one reques

PostPosted: Tue Jun 06, 2023 10:54 am
by Mike.Sheen
JuiceyBrucey wrote:Excellent. Thank you for that.
I tried to import it, but when saving it, I get this error message:
pluginerror1.png


There is a sticky topic in this forum "READ BEFORE POSTING" - one of the points it makes is you should "supply the version of Jiwa you are targeting".

You did not, so I did what any reasonable person would do and target the latest version - which is 7.2.1 SR16.

So, my plugin is compatible with that version - you are obviously using an older version.

Re: method of deleting all subscriber messages in one reques

PostPosted: Tue Jun 06, 2023 7:31 pm
by JuiceyBrucey
Yes, I am on SR15.
Sorting that out now.
Cheers

Re: method of deleting all subscriber messages in one reques

PostPosted: Wed Jun 07, 2023 12:28 pm
by JuiceyBrucey
I am about to install SR16, but will this mean my custom plugins will now need to be modified, or will they work ok in SR16?
Thank you

Re: method of deleting all subscriber messages in one reques

PostPosted: Wed Jun 07, 2023 1:55 pm
by Mike.Sheen
JuiceyBrucey wrote:I am about to install SR16, but will this mean my custom plugins will now need to be modified, or will they work ok in SR16?
Thank you


Unlikely, but it's pretty hard to say for sure without knowing what is in your custom plugins... but whenever we do introduce a potentially breaking change, the docs page for the release will make that potential breaking change quite clear and obvious - have you checked there?

The plugin I supplied you used a new method we introduced in SR16 to make it easier to read system settings - it can easily be adapted to use an older way, which would negate any need for you to move to the latest SR.

But, it is generally good practice to try and stay on the newer releases so it is a worthwhile exercise.

Re: method of deleting all subscriber messages in one reques

PostPosted: Tue Jun 13, 2023 4:13 pm
by JuiceyBrucey
Upgraded to SR16, all working well now.
Thank you very much.
Cheers