You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A serving slot named session is "Undefined method" in the served application, though its spec passes #451
module DB.Store
serving Store do
foul slot session(tokenDigest: String) -> Reply<Result<(String, Integer)?, String>> do
return { reply: DB.Repositories.Sessions.find(@connection, tokenDigest) }
end
end
sessionOf : Server<Store> -> String -> Result<(String, Integer)?, String>
foul sessionOf(store, tokenDigest) = flat(store.session(tokenDigest))
A spec that starts the store and calls sessionOf passes. In the application (tey run, which also links Rodolfo and Net.HTTP) the same call kills the server process:
** Generic server <0.84.0> terminating
** Last message in was {session,<<"12b00f75…">>}
** {<<"runtime error: Undefined method: session for DB.Store.Store">>,
[{kex_io,undefined_method,3,…},
{kex_intrinsic_process,handle_call,3,…},
Renaming the slot to holder fixed it; nothing else changed.
Looks related to #377 (slots not exported when the block sits in an imported module and Net.HTTP is in the program), which is closed. The other dozen slots in the same block are fine, so the name seems to matter.
Not yet minimized.
Environment: Kex 0.4.0-rc.1 (30c7979), Tey 0.2.1, Erlang/OTP 29.0.5 (Homebrew), macOS arm64. Found while building an application on Rodolfo 0.2 and Harmat 0.1.
A second instance, with a method on a record rather than a slot, and now with a single-spec reproduction of the "passes alone, fails when the HTTP stack is linked" part.
module DB.Repositories.Holdings
record HoldingRepository do
relation : Relation
owner : String
end
make HoldingRepository do
foul remove(id: String) -> Result<Bool, String> do
return @relation.deleted(id)
end
end
in the served application, and in a spec that merely also evaluates Config.Routes.routes(store, hub) (a module with using Rodolfo):
runtime error: Undefined method: remove for DB.Repositories.Holdings.HoldingRepository
Renaming the method to discard fixes it. The record's other methods (all, fetch, save, create, adopt) are unaffected, as were the store's other slots when session failed. No other record in the program defined a remove at the time, so this is not two user types colliding; it looks like a name that Rodolfo or Net.HTTP brings into the program taking over the dispatch for every receiver.
Type checking passes in both cases, so the only way to find these is to exercise each method in a program linked the way the application is.
Does not reproduce on current main (0fd796c), on either backend. The program links Net.HTTP and uses its Headers.remove. In it, a record's foul remove(id: String) -> Result<Bool, String> dispatches to the record's own function, and a serving slot named session called through a free sessionOf(store, tokenDigest) answers. The original program also links Rodolfo and was never minimised, so I'm leaving this open until it is checked in the application.
Confirmed and minimized on main (fc2586f), BEAM. A module DB.Store with a serving Store block that has two identical slots, session and holder, plus sessionOf(store, t) = store.session(t) and holderOf(store, t) = store.holder(t). Calling both from main:
with no other import, or with using Net.HTTP: both answer.
with using Net.HTTP.WebSocket in main: holderOf answers, and sessionOf fails with runtime error: Undefined method: session for Server.
So it is the name session colliding with something Net.HTTP.WebSocket brings in.
Activity
akoskovacs commentedon Oct 10, 2026
A second instance, with a method on a record rather than a slot, and now with a single-spec reproduction of the "passes alone, fails when the HTTP stack is linked" part.
DB.Repositories.Holdings.of(database, "x").remove("nope"):Config.Routes.routes(store, hub)(a module withusing Rodolfo):Renaming the method to
discardfixes it. The record's other methods (all,fetch,save,create,adopt) are unaffected, as were the store's other slots whensessionfailed. No other record in the program defined aremoveat the time, so this is not two user types colliding; it looks like a name that Rodolfo orNet.HTTPbrings into the program taking over the dispatch for every receiver.Type checking passes in both cases, so the only way to find these is to exercise each method in a program linked the way the application is.
akoskovacs commentedon Oct 17, 2026
Does not reproduce on current
main(0fd796c), on either backend. The program linksNet.HTTPand uses itsHeaders.remove. In it, a record'sfoul remove(id: String) -> Result<Bool, String>dispatches to the record's own function, and aservingslot namedsessioncalled through a freesessionOf(store, tokenDigest)answers. The original program also links Rodolfo and was never minimised, so I'm leaving this open until it is checked in the application.Records by type and names back, now that Kex fixed what they dodged
akoskovacs commentedon Oct 24, 2026
Confirmed and minimized on
main(fc2586f), BEAM. A moduleDB.Storewith aserving Storeblock that has two identical slots,sessionandholder, plussessionOf(store, t) = store.session(t)andholderOf(store, t) = store.holder(t). Calling both frommain:using Net.HTTP: both answer.using Net.HTTP.WebSocketinmain:holderOfanswers, andsessionOffails withruntime error: Undefined method: session for Server.So it is the name
sessioncolliding with somethingNet.HTTP.WebSocketbrings in.