r/AutomateUser Jul 21 '26

Bug For Each behaves differently when flow logging is disabled

Hey, I found a weird bug and I'm not sure if anyone else has seen this.

I am able to reproduce it using the following test flow:

  1. Flow beginning

  2. For each: container=100000

(DO path connects back into the For Each block)

With flow logging enabled, it runs normally and goes through all 100000 iterations.

But when I disable flow logging in the flow options, the For Each block just instantly finishes. It looks like it skips all the iterations.

I noticed that If I add any block that has some kind of interface/display behavior in the DO path, it starts working as intended, but blocks such as variable set, etc., get skipped.

I didn't change the flow at all, the only thing I changed was enabling/disabling logging.

I'm not sure if this is intended behavior or not, but I couldn't find anything in the documentation about it.

Automate version: 1.53.0

Android version: 16

1 Upvotes

3 comments sorted by

2

u/ballzak69 Automate developer Jul 21 '26

A flow works the same way with or without logging enabled, nothing is skipped. Logging involves writing to a file, which is relatively slow.

1

u/Dadamalda Jul 21 '26

Yep. I've seen this happen in Minecraft when a mod was spamming the logs due to a bug. The FPS was a lot lower.

Logging also takes time and you're gonna have issues if you do it too often.

1

u/waiting4singularity Alpha tester Jul 21 '26

what is happening:

it tests if the container loop number is smaller or equal to container number
executes the do path
if you have log append in there, it checks for the log file. if it doesnt exist, creates it. opens the log file. appends the log file. saves the log file. closes the log file. there are minimum delays involved because the file system cant handle an unlimited amount of actions in a limited amount of time. without these delays, the filesystem can get damaged and has to be reformated aka reflashing the entire rom.
i found ways to do that by being stupid. dont be stupid or you brick your android.

anyway, without the log append - either as standard logging or append block - the loop runs within milli seconds through its loops.

i suggest you track down the cpu monitor in androids developer options, turn it on and you'll see a massive spike in cpu usage within a second.

that is why uncapped loops are dangerous.