Variable Passing Bug

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Variable Passing Bug

Post by Desmanto » 18 Sep 2017 14:16

Automagic 1.34.0 has a new bug in variable passing when there is list or map element access. This is the flow to test the bug.
flow_Variable_bug.xml
(3.48 KiB) Downloaded 947 times
The flow consist of 3 script and 1 debug dialog. In script 1, just variable init. Second script is where the problem lies. I have b assigned to string, c to list[0] and d to map["second"]
The bug is : If there is a variable referring to any list or map elements just like c or d, then any variable declared in the same script won't appear in the elements after it.

You can try it to check at script 3, tap the variable and there is no b, c or d. The b, c, d also got red underlined, means the variables are not available. Strange thing is they all appear in debug dialog. So the variables are there, they simply disappear from selection. e also produce a proper list from b,c,d.

If in script 2, we comment out the c and d line, and uncomment the one that refer directly to the whole list and map (c = list and d = map), then b, c, d appear properly at script 3.

I tried at both my phone LP 5.1, 1.34.0, and both give same bug. Don't if everyone have the same problem. Tested in another LP 5.1 phone, with 1.33.0 installed, the bug doesn't appear. The b, c, d can be found at variable in script 3, even at script 2 refer to list/map element.
The bug is not fatal, but simply annoying. Because when compacting the flow I just curious why the variables are red underlined, even though I have properly declared it in the previous element and connect them. It slows down debugging process, since usually red underlined means undeclared/unavailable variables, which is usually the error.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Variable Passing Bug

Post by Martin » 18 Sep 2017 19:34

Thanks for reporting!
The next update (available in the next few hours) should improve the situation.

Regards,
Martin

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Variable Passing Bug

Post by Desmanto » 19 Sep 2017 02:26

Thanks Martin. The bug is solved within hours.

Sometimes trying to figure out how to consistently reproduce the bug takes more time. :)
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Variable Passing Bug

Post by Desmanto » 21 Sep 2017 05:32

Hi Martin,

There is still bug at the variable passing. Previously i just tested the right side.
if i use list reference at the left side, it will disappear as well, but still appear in debug dialog (same as before).

Add and change the line at script 2 to test.

Code: Select all

c = newList();
c[0] = list[0];
b,c,d disappear again from script 3.

Regards,
Desmanto
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Variable Passing Bug

Post by Martin » 22 Sep 2017 09:16

I can reproduce the problem. The fix for this problem was obviously not complete. It should be working as expected in the next update.
Thanks for reporting!

Regards,
Martin

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Variable Passing Bug

Post by Desmanto » 22 Sep 2017 15:54

You are welcome. It is not as annoying as the first one.
I just found it because playing with the new regex capturing group. Really a very nice addition to regex parsing.

Regards,
Desmanto
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Variable Passing Bug

Post by Desmanto » 22 Jan 2018 17:48

Desmanto wrote:Hi Martin,

There is still bug at the variable passing. Previously i just tested the right side.
if i use list reference at the left side, it will disappear as well, but still appear in debug dialog (same as before).

Add and change the line at script 2 to test.

Code: Select all

c = newList();
c[0] = list[0];
b,c,d disappear again from script 3.

Regards,
Desmanto
Bumping old thread. I reproduce the problem with 1.33.0 (in emulator), it seems it is already like that since 1.33.0. I just don't realize it yet, since I haven't started to use map/list.

Recently I heavily depends on map/list, thus the problem started to escalate quickly.
When the flow passed thru 10-20 elements, it started to be quite annoying to see the redline telling the variable isn't exist (while it actually exist in debug dialog).
It is just cosmetic, but sometimes i can wrong tap the red underline and mis-deleted or mis-correct it to something else.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Variable Passing Bug

Post by Martin » 23 Jan 2018 09:19

Sorry for the delay. The fix should become available in the next update (EAP soon).

Post Reply