Open perracodex opened 1 month ago
I don't see any createRouteScopedPlugin
in Koin. Is it something personal?
@arnaudgiuliani createRouteScopedPlugin
is part of Ktor, not Koin. It’s used to create plugins scoped to specific routes in Ktor. See above an attached sample project.
Describe the bug I encountered unexpected behavior regarding Request Scope lifecycle declared variables in Ktor, when using
createRouteScopedPlugin
.It appears that when declaring a value using
call.scope.declare
within theAuthenticationChecked
hook, the value persists across different calls instead of being discarded after the call completes. In addition, the declared value in the scope is not propagated through the pipeline.Please find the attached sample project and refer to the console output for further details
To Reproduce Find attached project. Open the localhost as shown in the console when the project starts. Keep refreshing the browser to see the results in the console.
Expected behavior
Koin module and version:
koin-core:4.0.0
Snippet or Sample project to help reproduce
ktor-koin.zip
Short snippet from the project, for quick context: