ronantakizawa/codereview-bench huggingface dataset:
Repository: JuliaLang/julia
File: src/module.c (C)

Code before:
    while (value == -1 && m->parent != m && m != jl_base_module) {
        m = m->parent;
        value = m->max_methods;
    }
    return value;
}

JL_DLLEXPORT void jl_set_istopmod(jl_module_t *self, uint8_t isprimary)
{
    self->istopmod = 1;
    if (isprimary) {
        jl_top_module = self;
    }
}

JL_DLLEXPORT uint8_t jl_istopmod(jl_module_t *mod)
{
    return mod->istopmod;
}

static jl_globalref_t *jl_new_globalref(jl_module_t *mod, jl_sym_t *name, jl_binding_t *b)
{
    jl_task_t *ct = jl_current_task;
    jl_globalref_t *g = (jl_globalref_t*)jl_gc_alloc(ct->ptls, sizeof(jl_globalref_t), jl_globalref_type);
    if (jl_globalref_type->smalltag)
        jl_set_typetagof(g, jl_globalref_type->smalltag, 0);
    g->mod = mod;
    jl_gc_wb_fresh(g, g->mod);
    g->name = name;
    jl_gc_wb_fresh(g, g->name);
    g->binding = b;
    jl_gc_wb_fresh(g, g->binding);
    return g;
}

static jl_binding_t *new_binding(jl_module_t *mod, jl_sym_t *name)
{
    jl_task_t *ct = jl_current_task;
    assert(jl_is_module(mod) && jl_is_symbol(name));
    jl_binding_t *b = (jl_binding_t*)jl_gc_alloc(ct->ptls, sizeof(jl_binding_t), jl_binding_type);
    jl_atomic_store_relaxed(&b->value, NULL);
    jl_atomic_store_relaxed(&b->partitions, NULL);
    b->globalref = NULL;
    b->backedges = NULL;
    jl_atomic_store_relaxed(&b->flags, 0);
    JL_GC_PUSH1(&b);
    b->globalref = jl_new_globalref(mod, name, b);
    jl_gc_wb(b, b->globalref);
    JL_GC_POP();
    return b;
}

Review comment (suggestion):
nit: slightly more canonical form?
```suggestion
    jl_set_typetagof(g, jl_globalref_tag, 0);
```

Code after:
    while (value == -1 && m->parent != m && m != jl_base_module) {
        m = m->parent;
        value = m->max_methods;
    }
    return value;
}

JL_DLLEXPORT void jl_set_istopmod(jl_module_t *self, uint8_t isprimary)
{
    self->istopmod = 1;
    if (isprimary) {
        jl_top_module = self;
    }
}

JL_DLLEXPORT uint8_t jl_istopmod(jl_module_t *mod)
{
    return mod->istopmod;
}

static jl_globalref_t *jl_new_globalref(jl_module_t *mod, jl_sym_t *name, jl_binding_t *b)
{
    jl_task_t *ct = jl_current_task;
    jl_globalref_t *g = (jl_globalref_t*)jl_gc_alloc(ct->ptls, sizeof(jl_globalref_t), jl_globalref_type);
    jl_set_typetagof(g, jl_globalref_tag, 0);
    g->mod = mod;
    jl_gc_wb_fresh(g, g->mod);
    g->name = name;
    jl_gc_wb_fresh(g, g->name);
    g->binding = b;
    jl_gc_wb_fresh(g, g->binding);
    return g;
}

static jl_binding_t *new_binding(jl_module_t *mod, jl_sym_t *name)
{
    jl_task_t *ct = jl_current_task;
    assert(jl_is_module(mod) && jl_is_symbol(name));
    jl_binding_t *b = (jl_binding_t*)jl_gc_alloc(ct->ptls, sizeof(jl_binding_t), jl_binding_type);
    jl_atomic_store_relaxed(&b->value, NULL);
    jl_atomic_store_relaxed(&b->partitions, NULL);
    b->globalref = NULL;
    b->backedges = NULL;
    jl_atomic_store_relaxed(&b->flags, 0);
    JL_GC_PUSH1(&b);
    b->globalref = jl_new_globalref(mod, name, b);
    jl_gc_wb(b, b->globalref);
    JL_GC_POP();
    return b;
}
Repository: JuliaLang/julia
File: base/abstractarraymath.jl (Julia)

Code before:
1:3
```

See also [`reshape`](@ref), [`dropdims`](@ref).
"""
vec(a::AbstractArray) = reshape(a,length(a))
vec(a::AbstractVector) = a

_sub(::Tuple{}, ::Tuple{}) = ()
_sub(t::Tuple, ::Tuple{}) = t
_sub(t::Tuple, s::Tuple) = _sub(tail(t), tail(s))

"""
    dropdims(A; dims)

Return an array with the same data as `A`, but with the dimensions specified by
`dims` removed.

Repeated dimensions or numbers outside `1:ndims(A)` are forbidden.
Moreover `size(A,d)` must equal 1 for every `d` in `dims`.

The result shares the same underlying data as `A`, such that the
result is mutable if and only if `A` is mutable, and setting elements of one
alters the values of the other.

Inverse of [`dropdims`](@ref).
See also: [`reshape`](@ref), [`vec`](@ref).

# Examples
```jldoctest
julia> a = reshape(Vector(1:4),(2,2,1,1))
2×2×1×1 Array{Int64, 4}:
[:, :, 1, 1] =
 1  3
 2  4

julia> b = dropdims(a; dims=3)
2×2×1 Array{Int64, 3}:
[:, :, 1] =
 1  3
 2  4

julia> b[1,1,1] = 5; a
2×2×1×1 Array{Int64, 4}:
[:, :, 1, 1] =
 5  3
 2  4
```
"""
dropdims(A; dims) = _dropdims(A, dims)
function _dropdims(A::AbstractArray, dims::Dims)

Review comment (suggestion):
```suggestion
Inverse of [`insertdims`](@ref).
```

Code after:
1:3
```

See also [`reshape`](@ref), [`dropdims`](@ref).
"""
vec(a::AbstractArray) = reshape(a,length(a))
vec(a::AbstractVector) = a

_sub(::Tuple{}, ::Tuple{}) = ()
_sub(t::Tuple, ::Tuple{}) = t
_sub(t::Tuple, s::Tuple) = _sub(tail(t), tail(s))

"""
    dropdims(A; dims)

Return an array with the same data as `A`, but with the dimensions specified by
`dims` removed.

Repeated dimensions or numbers outside `1:ndims(A)` are forbidden.
Moreover `size(A,d)` must equal 1 for every `d` in `dims`.

The result shares the same underlying data as `A`, such that the
result is mutable if and only if `A` is mutable, and setting elements of one
alters the values of the other.

Inverse of [`insertdims`](@ref).
See also: [`reshape`](@ref), [`vec`](@ref).

# Examples
```jldoctest
julia> a = reshape(Vector(1:4),(2,2,1,1))
2×2×1×1 Array{Int64, 4}:
[:, :, 1, 1] =
 1  3
 2  4

julia> b = dropdims(a; dims=3)
2×2×1 Array{Int64, 3}:
[:, :, 1] =
 1  3
 2  4

julia> b[1,1,1] = 5; a
2×2×1×1 Array{Int64, 4}:
[:, :, 1, 1] =
 5  3
 2  4
```
"""
dropdims(A; dims) = _dropdims(A, dims)
function _dropdims(A::AbstractArray, dims::Dims)
Repository: JuliaLang/julia
File: test/download_exec.jl (Julia)

Code before:
# This file is a part of Julia. License is MIT: https://julialang.org/license

module TestDownload

using Test

mktempdir() do temp_dir
    url = try
        download("https://httpbin.julialang.org")
        "https://httpbin.julialang.org"
    catch
        "https://httpbingo.julialang.org/"
    end
    # Download a file
    file = joinpath(temp_dir, "ip")
    @test download("$url/ip", file) == file
    @test isfile(file)
    @test !isempty(read(file))
    ip = read(file, String)

    # Download an empty file
    empty_file = joinpath(temp_dir, "empty")
    @test download("$url/status/200", empty_file) == empty_file
    @test isfile(empty_file)
    @test isempty(read(empty_file))

    # Make sure that failed downloads do not leave files around
    missing_file = joinpath(temp_dir, "missing")
    @test_throws Exception download("$url/status/404", missing_file)
    @test !isfile(missing_file)

    # Use a TEST-NET (192.0.2.0/24) address which shouldn't be bound
    invalid_host_file = joinpath(temp_dir, "invalid_host")
    @test_throws Exception download("http://192.0.2.1", invalid_host_file)
    @test !isfile(invalid_host_file)
end


Review comment (suggestion):
```suggestion
    catch ex
        bt = catch_backtrace()
        @info "Looks like there is a problem with a JuliaLang mirror of httpbin(go)" exception=(ex,bt)
        "https://httpbingo.julialang.org/"
```

Code after:
# This file is a part of Julia. License is MIT: https://julialang.org/license

module TestDownload

using Test

mktempdir() do temp_dir
    url = try
        download("https://httpbingo.julialang.org")
        "https://httpbingo.julialang.org"
    catch ex
        bt = catch_backtrace()
        @info "Looks like there is a problem with a JuliaLang mirror of httpbingo"
        @info "Trying httpbin" exception=(ex,bt)
        "https://httpbin.julialang.org/"
    end
    # Download a file
    file = joinpath(temp_dir, "ip")
    @test download("$url/ip", file) == file
    @test isfile(file)
    @test !isempty(read(file))
    ip = read(file, String)

    # Download an empty file
    empty_file = joinpath(temp_dir, "empty")
    @test download("$url/status/200", empty_file) == empty_file
    @test isfile(empty_file)
    @test isempty(read(empty_file))

    # Make sure that failed downloads do not leave files around
    missing_file = joinpath(temp_dir, "missing")
    @test_throws Exception download("$url/status/404", missing_file)
    @test !isfile(missing_file)

    # Use a TEST-NET (192.0.2.0/24) address which shouldn't be bound
    invalid_host_file = joinpath(temp_dir, "invalid_host")
    @test_throws Exception download("http://192.0.2.1", invalid_host_file)
Repository: JuliaLang/julia
File: JuliaLowering/test/scopes_ir.jl (Julia)

Code before:
6   (isdefined slot₁/y)
7   (gotoifnot %₆ label₁₀)
8   slot₁/y
9   (call top.setindex! %₅ %₈ :y)
10  (return %₅)

########################################
# @locals with function args (TODO: static parameters)
function f(z)
    @locals
end
#---------------------
1   (method TestMod.f)
2   latestworld
3   TestMod.f
4   (call core.Typeof %₃)
5   (call core.svec %₄ core.Any)
6   (call core.svec)
7   SourceLocation::1:10
8   (call core.svec %₅ %₆ %₇)
9   --- method core.nothing %₈
    slots: [slot₁/#self# slot₂/z]
    1   (call core.apply_type top.Dict core.Symbol core.Any)
    2   (call %₁)
    3   (gotoifnot true label₅)
    4   (call top.setindex! %₂ slot₁/#self# :#self#)
    5   (gotoifnot true label₇)
    6   (call top.setindex! %₂ slot₂/z :z)
    7   (return %₂)
10  latestworld
11  TestMod.f
12  (return %₁₁)

########################################
# Error: Duplicate function argument names
function f(x, x)
end
#---------------------
LoweringError:
function f(x, x)
#             ╙ ── function argument name not unique
end

########################################
# Error: Duplicate function argument with destructured arg
function f(x, (x,))
end
#---------------------
LoweringError:
function f(x, (x,))
#              ╙ ── destructured argument name `x` conflicts with an existing argument from the same scope

Review comment (bug):
`@locals` should not (or currently does not, in flisp) include internal names so I think this is a bug.

Code after:
6   (isdefined slot₁/y)
7   (gotoifnot %₆ label₁₀)
8   slot₁/y
9   (call top.setindex! %₅ %₈ :y)
10  (return %₅)

########################################
# @locals with function args (TODO: static parameters)
function f(z)
    @locals
end
#---------------------
1   (method TestMod.f)
2   latestworld
3   TestMod.f
4   (call core.Typeof %₃)
5   (call core.svec %₄ core.Any)
6   (call core.svec)
7   SourceLocation::1:10
8   (call core.svec %₅ %₆ %₇)
9   --- method core.nothing %₈
    slots: [slot₁/#self#(!read) slot₂/z]
    1   (call core.apply_type top.Dict core.Symbol core.Any)
    2   (call %₁)
    3   (gotoifnot true label₅)
    4   (call top.setindex! %₂ slot₂/z :z)
    5   (return %₂)
10  latestworld
11  TestMod.f
12  (return %₁₁)

########################################
# Error: Duplicate function argument names
function f(x, x)
end
#---------------------
LoweringError:
function f(x, x)
#             ╙ ── function argument name not unique
end

########################################
# Error: Duplicate function argument with destructured arg
function f(x, (x,))
end
#---------------------
LoweringError:
function f(x, (x,))
#              ╙ ── destructured argument name `x` conflicts with an existing argument from the same scope
end
Repository: JuliaLang/julia
File: JuliaLowering/test/closures.jl (Julia)

Code before:
    function f_many_closure_sp()
        function (); function (); function (x::T) where T; (x, T) end; end; end
    end
    f_many_closure_sp()()()(1)
end
""") == (1, Int)

@test_broken JuliaLowering.include_string(test_mod, """
begin
    function f_many_closure_sp_capt(x::T where T)
        function (); function (); function (); (x, T) end; end; end
    end
    f_many_closure_sp_capt(1)()()()
end
""") == (1, Int)

@test_broken JuliaLowering.include_string(test_mod, """
begin
    function f_argcapt_sp(x::T) where T
        (inner_x::T)->(x, inner_x, T)
    end
    f_argcapt_sp(1)(2)
end
""") == (1, 2, Int)

# Note this doesn't work in flisp either
@test_broken JuliaLowering.include_string(test_mod, """
begin
    function f_typevarcapt_sp(x::T) where T
        function inner(y::U) where {U<:T}
            (x,y,T,U)
        end
    end
    f_typevarcapt_sp(1)(2)
end
""") == (1,2,Int,Int)

# https://github.com/JuliaLang/JuliaLowering.jl/issues/134#issuecomment-3739626003
JuliaLowering.include_string(test_mod, """
function f_update_outer_capture()
    local response # declare outside closure
    f = ()->begin
        response = 1
    end
    f()
    return (f, response)
end
""")
let (f, response) = test_mod.f_update_outer_capture()
    @test f.response isa Core.Box
    @test response == 1

Review comment (suggestion):
```suggestion
# Inner method typevar `U` depending on a static parameter `T` so hoisting the method def
# for `inner` out to top level would require detecting this and making `inner` parametric on `T`.
# Note this doesn't work in flisp either
```

Code after:
    function f_many_closure_sp()
        function (); function (); function (x::T) where T; (x, T) end; end; end
    end
    f_many_closure_sp()()()(1)
end
""") == (1, Int)

@test JuliaLowering.include_string(test_mod, """
begin
    function f_many_closure_sp_capt(x::T) where T
        function (); function (); function (); (x, T) end; end; end
    end
    f_many_closure_sp_capt(1)()()()
end
""") == (1, Int)

@test_broken JuliaLowering.include_string(test_mod, """
begin
    function f_argcapt_sp(x::T) where T
        (inner_x::T)->(x, inner_x, T)
    end
    f_argcapt_sp(1)(2)
end
""") == (1, 2, Int)

# Inner method typevar `U` depending on a static parameter `T` so hoisting the
# method def for `inner` out to top level would require detecting this and
# making `inner` parametric on `T`.  Note this doesn't work in flisp either.
@test_broken JuliaLowering.include_string(test_mod, """
begin
    function f_typevarcapt_sp(x::T) where T
        function inner(y::U) where {U<:T}
            (x,y,T,U)
        end
    end
    f_typevarcapt_sp(1)(2)
end
""") == (1,2,Int,Int)

# https://github.com/JuliaLang/JuliaLowering.jl/issues/134#issuecomment-3739626003
JuliaLowering.include_string(test_mod, """
function f_update_outer_capture()
    local response # declare outside closure
    f = ()->begin
        response = 1
    end
    f()
    return (f, response)
end
""")
let (f, response) = test_mod.f_update_outer_capture()
Repository: JuliaLang/julia
File: base/filesystem.jl (Julia)

Code before:
# This file is a part of Julia. License is MIT: https://julialang.org/license

## File Operations (Libuv-based) ##

"""
    JL_O_APPEND
    JL_O_ASYNC
    JL_O_CLOEXEC
    JL_O_CREAT
    JL_O_DIRECT
    JL_O_DIRECTORY
    JL_O_DSYNC
    JL_O_EXCL
    JL_O_FSYNC
    JL_O_LARGEFILE
    JL_O_NDELAY
    JL_O_NOATIME
    JL_O_NOCTTY
    JL_O_NOFOLLOW
    JL_O_NONBLOCK
    JL_O_PATH
    JL_O_RANDOM
    JL_O_RDONLY
    JL_O_RDWR
    JL_O_RSYNC
    JL_O_SEQUENTIAL
    JL_O_SHORT_LIVED
    JL_O_SYNC
    JL_O_TEMPORARY
    JL_O_TMPFILE
    JL_O_TRUNC

Review comment (suggestion):
```suggestion
# n.b. this file is `Core.eval`-uated into (pre-existing) Base.Filesystem
# module Filesystem
```

Code after:
# This file is a part of Julia. License is MIT: https://julialang.org/license

# NB: This file is `Core.eval`-uated into the (pre-existing) module Filesystem

## File Operations (Libuv-based) ##

"""
    JL_O_APPEND
    JL_O_ASYNC
    JL_O_CLOEXEC
    JL_O_CREAT
    JL_O_DIRECT
    JL_O_DIRECTORY
    JL_O_DSYNC
    JL_O_EXCL
    JL_O_FSYNC
    JL_O_LARGEFILE
    JL_O_NDELAY
    JL_O_NOATIME
    JL_O_NOCTTY
    JL_O_NOFOLLOW
    JL_O_NONBLOCK
    JL_O_PATH
    JL_O_RANDOM
    JL_O_RDONLY
    JL_O_RDWR
    JL_O_RSYNC
    JL_O_SEQUENTIAL
    JL_O_SHORT_LIVED
    JL_O_SYNC
    JL_O_TEMPORARY
Repository: JuliaLang/julia
File: test/intrinsics.jl (Julia)

Code before:
        x == 2 && return Int(0)
        x == 3 && return C_NULL
        return nothing
    end
    function _bitcast_trigger(x::Int)
        val = _bitcast_returns_union(x)
        return Core.Intrinsics.bitcast(Ptr{Nothing}, val)
    end
    @test _bitcast_trigger(1) === Ptr{Nothing}(0)
    @test _bitcast_trigger(3) === Ptr{Nothing}(0)
end

# Test unsafe_store! on union values with inline_roots (split representation)
@testset "pointerset union with inline_roots" begin
    struct PointersetMixedGC
        a::Vector{Int}
        b::Int
    end
    @noinline function _pointerset_returns_union(x::Int)
        x == 0 && return PointersetMixedGC(Int[1,2,3], 42)
        x == 1 && return UInt(0)
        return nothing
    end
    function _pointerset_trigger(x::Int)
        val = _pointerset_returns_union(x)::PointersetMixedGC
        buf = Vector{PointersetMixedGC}(undef, 2)
        GC.@preserve buf val begin
            p = pointer(buf)
            unsafe_store!(p, val, 1)
            unsafe_store!(p, val, 2)
            r1 = unsafe_load(p, 1)
            r2 = unsafe_load(p, 2)
        end
        return r1.a, r1.b, r2.a, r2.b
    end
    @test _pointerset_trigger(0) == (Int[1,2,3], 42, Int[1,2,3], 42)
end


Review comment (bug):
This triggers some UB and may make the GC segfault (since the unsafe_store isn't visible, so in rare cases the `val` might survive after the preserve block ends but not the contents). Can you use a `Libc.malloc` for buf to avoid any issues

Code after:
        x == 2 && return Int(0)
        x == 3 && return C_NULL
        return nothing
    end
    function _bitcast_trigger(x::Int)
        val = _bitcast_returns_union(x)
        return Core.Intrinsics.bitcast(Ptr{Nothing}, val)
    end
    @test _bitcast_trigger(1) === Ptr{Nothing}(0)
    @test _bitcast_trigger(3) === Ptr{Nothing}(0)
end

# Test unsafe_store! on union values with inline_roots (split representation)
@testset "pointerset union with inline_roots" begin
    struct PointersetMixedGC
        a::Vector{Int}
        b::Int
    end
    @noinline function _pointerset_returns_union(x::Int)
        x == 0 && return PointersetMixedGC(Int[1,2,3], 42)
        x == 1 && return UInt(0)
        return nothing
    end
    function _pointerset_trigger(x::Int)
        val = _pointerset_returns_union(x)::PointersetMixedGC
        p = Ptr{PointersetMixedGC}(Libc.malloc(2 * sizeof(PointersetMixedGC)))
        GC.@preserve val begin
            unsafe_store!(p, val, 1)
            unsafe_store!(p, val, 2)
            r1 = unsafe_load(p, 1)
            r2 = unsafe_load(p, 2)
        end
        Libc.free(p)
        return r1.a, r1.b, r2.a, r2.b
    end
    @test _pointerset_trigger(0) == (Int[1,2,3], 42, Int[1,2,3], 42)
end
Repository: JuliaLang/julia
File: JuliaLowering/src/binding_analysis.jl (Julia)

Code before:
    for (id, from_outer_lambda) in lambda_bindings.locals_capt
        b = get_binding(ctx, id)
        !b.is_captured && continue
        from_outer_lambda && continue
        if b.is_assigned_once && b.kind in (:local, :argument)
            push!(candidates, id)
        end
    end
    isempty(candidates) && return

    state = DefUseState(ctx, candidates)
    @stm ex begin
        [K"lambda" _ _ body] -> du_visit!(ctx, state, body)
        [K"lambda" _ _ body rett] -> (du_visit!(ctx, state, body);
                                      du_visit!(ctx, state, rett))
    end

    for id in union(state.live, state.unused)
        if id in state.seen
            b = get_binding(ctx, id)
            if b.kind === :argument
                # do this here so we don't mix the flag we're setting and the
                # existing is_always_defined flag on arguments
                b.unboxed = true
            end
            b.is_always_defined = true
        end
    end
    for (id, capt) in lambda_bindings.locals_capt
        capt && continue
        b = get_binding(ctx, id)
        if b.kind === :local && b.is_always_defined
            b.unboxed = true
        end
    end
end


Review comment (suggestion):
```suggestion
            # safe-to-unbox implies is-always-defined (but not vice-versa)
            b.safe_to_unbox = true
            b.is_always_defined = true
```

this may be clearer than the separate `for` loop below, since the is_always_defined check is not actually sufficient on its own, which is why we cannot use it for arguments

Code after:
    for (id, from_outer_lambda) in lambda_bindings.locals_capt
        b = get_binding(ctx, id)
        !b.is_captured && continue
        from_outer_lambda && continue
        if b.is_assigned_once && b.kind in (:local, :argument)
            push!(candidates, id)
        end
    end
    isempty(candidates) && return

    state = DefUseState(ctx, candidates)
    @stm ex begin
        [K"lambda" _ _ body] -> du_visit!(ctx, state, body)
        [K"lambda" _ _ body rett] -> (du_visit!(ctx, state, body);
                                      du_visit!(ctx, state, rett))
    end

    for id in union(state.live, state.unused)
        if id in state.seen
            b = get_binding(ctx, id)
            b.unboxed = true
            b.is_always_defined = true
        end
    end
end
Repository: Kholid060/automa
File: src/workflowEngine/WorkflowWorker.js (JavaScript)

Code before:
      });
    }

    currentColumn.index += 1;
  }

  setVariable(name, value) {
    let variableName = name;
    const vars = this.engine.referenceData.variables;

    if (name.startsWith('$push:')) {
      const { 1: varName } = name.split('$push:');

      if (!objectHasKey(vars, varName)) vars[varName] = [];
      else if (!Array.isArray(vars[varName])) vars[varName] = [vars[varName]];

      vars[varName].push(value);
      variableName = varName;
    } else {
      vars[name] = value;
    }

    if (variableName.startsWith('$$')) {
      dbStorage.variables.put({
        value,
        name: variableName,
      });
    }

    this.engine.addRefDataSnapshot('variables');
  }

  getBlockConnections(blockId, outputIndex = 1) {
    if (this.engine.isDestroyed) return null;

    const outputId = `${blockId}-output-${outputIndex}`;
    const connections = this.engine.connectionsMap[outputId];

    if (!connections) return null;

    return [...connections.values()];
  }

  executeNextBlocks(
    connections,
    prevBlockData,
    nextBlockBreakpointCount = null
  ) {
    // pre check
    for (const connection of connections) {
      const id = typeof connection === 'string' ? connection : connection.id;

Review comment (refactor):
My workflow keeps running repeatedly while it should be once per day (by checking variables in workflow). Then I found in Storage tab, the variables are prefixed with duplicated "$$". So, I guess this is the cause.

In previous code, the variable's name was sliced: https://github.com/AutomaApp/automa/pull/1522/files#diff-e2be43c3a6d1b35564d0d2980d83866ffef90cca2e66eded0a5ac7b47db31a08L509

Code after:
      });
    }

    currentColumn.index += 1;
  }

  setVariable(name, value) {
    let variableName = name;
    const vars = this.engine.referenceData.variables;

    if (name.startsWith('$push:')) {
      const { 1: varName } = name.split('$push:');

      if (!objectHasKey(vars, varName)) vars[varName] = [];
      else if (!Array.isArray(vars[varName])) vars[varName] = [vars[varName]];

      vars[varName].push(value);
      variableName = varName;
    } else {
      vars[name] = value;
    }

    if (variableName.startsWith('$$')) {
      dbStorage.variables.put({
        value,
        name: variableName.slice(2),
      });
    }

    this.engine.addRefDataSnapshot('variables');
  }

  getBlockConnections(blockId, outputIndex = 1) {
    if (this.engine.isDestroyed) return null;

    const outputId = `${blockId}-output-${outputIndex}`;
    const connections = this.engine.connectionsMap[outputId];

    if (!connections) return null;

    return [...connections.values()];
  }

  executeNextBlocks(
    connections,
    prevBlockData,
    nextBlockBreakpointCount = null
  ) {
    // pre check
    for (const connection of connections) {
      const id = typeof connection === 'string' ? connection : connection.id;