method of deleting all subscriber messages in one request?  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

method of deleting all subscriber messages in one request?

Postby JuiceyBrucey » Thu Jun 01, 2023 8:09 am

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
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

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

Postby Mike.Sheen » Thu Jun 01, 2023 12:39 pm

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.
Attachments
Plugin Webhook Retention.xml
(12.53 KiB) Downloaded 91 times
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: method of deleting all subscriber messages in one reques

Postby JuiceyBrucey » Mon Jun 05, 2023 10:40 am

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 2455 times
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

Re: method of deleting all subscriber messages in one reques

Postby Mike.Sheen » Tue Jun 06, 2023 10:54 am

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: method of deleting all subscriber messages in one reques

Postby JuiceyBrucey » Tue Jun 06, 2023 7:31 pm

Yes, I am on SR15.
Sorting that out now.
Cheers
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

Re: method of deleting all subscriber messages in one reques

Postby JuiceyBrucey » Wed Jun 07, 2023 12:28 pm

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
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

Re: method of deleting all subscriber messages in one reques

Postby Mike.Sheen » Wed Jun 07, 2023 1:55 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: method of deleting all subscriber messages in one reques

Postby JuiceyBrucey » Tue Jun 13, 2023 4:13 pm

Upgraded to SR16, all working well now.
Thank you very much.
Cheers
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 21 guests