Server addon writing correct value to folder but folder shows previous task status

Hi, I’m building a server addon that syncs a compositing task status to its parent folder.
My onTaskChange handler subscribes to entity.task.status_changed via EventStream.subscribe. The event log confirms newValue is correct. I write it to the folder via Postgres.execute. The log.info confirms the correct value is being written.
But after refreshing, the folder shows the previous task status, not the current one.
Without the addon, nothing touches the folder status. So something in my addon or AYON’s processing is writing the old value after my write.
My questions:
1. Does EventStream.subscribe fire before or after AYON commits the change to the database?
2. Is there anything in AYON’s internals that would overwrite a folder status after a task status change?
3. Is Postgres.execute the correct way to update folder status from a server addon, or should I use FolderEntity.save()?
Thanks!

This would probably be easier to debug what’s going wrong on your end if you can share roughly what code you’re running (e.g. a code snippet).