Thanks for preparing the repo. The issue is in the query call. All RNG modifications done by a query are discarded at the end of a query. That’s because queries are read-only by design.
If you change this line from query
to update
, then it should work as expected.