wa-automate-nodejs
wa-automate-nodejs copied to clipboard
Update patches without restarting session 🪄🔄
live patches
Idea: Check every X (30?) minute for an Update Download the new update while runtime (maybe with an event? onPatchUpdate()) in that event users could use client.applyNewPatch() or you force the new Patch with the popup stuff coming from whatsapp itself where you need to inject again anyway (just delete me if you had already ideas how to do this)
I was thinking along the lines of:
- every time the patches are update it sends an mqtt event to your sessions which fires an event
- and/or there's an endpoint
https://patches.openwa.dev/hash
which simply returns the current patch hash - if it is different then it fires an event (problem then is that the result of the endpoint itself will most likely be cached) - and/or listen to a keyboard event (e.g
p
) which will then trigger a manual session re-patch. - and/or create a function that will re-patch your session based on your own use cases
I thought this was a nice-to-have but with recent concerning reports about long launch times I might have to prioritise this.
One downside is that every re-patch will require a new license request. So that latency also needs to be taken into consideration.