5.18.1 is running ScanEvents out of order
hambold opened this issue ยท 5 comments
Is there an existing issue for this?
- I have searched the existing open and closed issues.
Description
Hey,
this is an issue introduced in 5.18.1 and it is working as expected in 5.18.0.
It used to be that code called via a ScanEvent would be executed before the lines that followed it.
This is no longer the case in 5.18.1.
I hope the attached image explains the issue. I've also attached the import code to this test WA.
I hope this is a bug and not the way it is intended to work in the future :|
WeakAuras Version
5.18.1
World of Warcraft Flavor
Retail (Default)
World of Warcraft Region
EU
Tested with only WeakAuras
I got this issue with only WeakAuras enabled
Lua Error
No response
Reproduction Steps
- Import the provided WA
- Open options
- Repeatedly select and deselect the WA to print the result in chat
Last Good Version
5.18.0
Screenshots
Export String
!WA:2!Lv1tVTTnu86Mb0eTTUeVUGvGEWWaRWziWBTajyya9GvQDskCS9KuwYo5qj(KfNLj1iPCs6T6t9C(cmaFE7IVS75tGGXW(a0d7(YNGrsjN)0Odsp(47p)E)EpsvQvz87RXpVByOaKLMIbbsMYrsiAgHgY4JqscJADfIgeX4T4OrG35jGV7oonB25ceLKBX22JqeAlBPAtBkJcZX6WO2PVwfxabmkwmbqctaYw5sTORKd0bYOh5iKiUSv2YzRKzL9PzFM67N)i)qcLiI(y1xneGKgIeiq6OZr0fcioShJqL(70SJxtNldySym7uAt8aiAkrLCxwkpaE2d4NvuSZrPsvn1nrJsH1KfUCIFeqgejFNVYRqYaRzi8VMkKa(ac9HoNsWYO35eWIz83SK6jz1ub0OWeLrOZI(qcNnGdcrEs)2N9GhM8KfX3dot(AIa5hd4ORuyg4uu8pR4ifo(9z5mTPyYk7GItIqlz)wgBuPQeCYA2m(qaxXnarBogOsXSqDtrrKiPYqDLEYuomqfldp)8PAINKxJFmuj0O5lGL7PKe4KBQv0zpKtOJ1TUi7ygc3YjigjeR7mknwsSS18)6zFNLVefRaIw0wqElOfMks9DmGq8JRNT8C1sFuWWbCwkf)(NCPuXb9hteefjCsYxAwQAhm9WuWrAg2UHA5uotQMf1mMDNUDAopNCoErh04xiJk1LkV7HET3VtZKYg1IiKQS(LctVk3uYza2e(3DX1(MSAlo5Tv(PuewZHv88YHNMhiHNNvopnNY44J4OKjhvi8H80SyYZUXHEDZJQ(v1VruG2fqiz1BHRDmJpLkvAPc13QTNS2(D600PVDxpVUh4S)U75n1yZnZCzlZvuQwzYtVoL9ZpV2xuiKTYDOI7ZAUQU1t)3lvZe7gxaPOlgSq0KiZY2ekiwZwlgnr)wt3Z9tLsgTRAcjgD(mT6fv6CJnrKGHk)efGvRBQjAMt8FLrwnnJbEKX7JVT3T4WVLc0GZ79jFF9xU1LADVU4gLCqPobedlnrYjdgOgsF8ZViLwSWIxi8pZcunr2O(rem4ijJaS6ko)0WqZaZEnB3R1HTNOMKJJ3hlS(GcNG(uvpoOMvCC71SD7Rv6Q8JC2S(70W1RVRxdhp)8WN8FHP0an0QzmCZ61RVHvf1J5fjSIrDLx9Qkv72ZB)UDCRwrgbuZ26NJa0WgQYtu)Md21Q6bcPrU6gxBzI6qPS2UG0tvn12yZkvDnxTEltmcqSaUtIVjy3n13pGTiCH8EXJIZRiTGLL6g5H5SIiPCrnTzLRZHJzl)9auSmYHQUGsyTOxO)FqgZoLsK(jQrhG7eebbdZyjRHuS4yWlV7Dadd)XdMkzbJZVC8Rl9N)fhziAX22QFniTYESv2xyLuwndVtXfzk3u)vao5LPe8SJQTv32BSD7whWlpQmUSWFR6V4hQ)IYJ)7J))
Bisector Report
No response
If you have a specific use case that can't be modified to handle asynchronous handling of ScanEvents, I'd like to hear it.
that is indeed a new behaviour. if you have a reason why it should differently you have to show a usecase.
There never was any gurantee on how exactly WeakAuras.ScanEvents behaves.
It has now changed behaviour and might again in the future.
If you have a specific use case that can't be modified to handle asynchronous handling of ScanEvents, I'd like to hear it.
In the Discord you guys keep advising us to avoid the use of globals and to use ScanEvents instead, if we wish to send stuff between different WeakAuras. So if I use these to request a list from another WA for example, I need to receive it before I can run the rest of my code.
I'm able to work around it, but it's unintuitive and clunky.
I saw in the discussion around the "Click() actions" ticket that ScanEvents doesn't continue the hardware event chain.
I've been using a WA that uses a ScanEvents macro to kick off some code to determine what I should be crafting next and then sends either C_TradeSkillUI.CraftSalvage() or C_TradeSkillUI.CraftRecipe().
It was just a convenient little thing I was using and it's something that AddOns are still allowed to do, but with 5.18.1 it's no longer allowed and I guess it falls under "unintentional breakage, which we aren't going to fix." as Infus said.
I realize I'm not making a strong case here, but I'm not a programmer by trade and I imagine many authors aren't either. I would have never tried learning Lua if it wasn't for WeakAuras, because it was so much more convenient to get into than trying to write an AddOn.
I don't know, from my perspective it's just a frustrating and annoying change, especially because I don't understand why it was necessary and I just wanted to yell it into the void, I guess.
Thanks for your work regardless and Happy Holidays!
The reason for that was someone sending a ScanEvents to itself, which then made the aura's function running recursively, and the called functions would modify the states in a way that would confuse the functions calling them. Queueing prevents the inner functions from changing the states in a way the outer functions wouldn't expect.