ktorio / ktorio/ktor

Dependency modules not auto-reloading

Open
#1,232 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
14.5k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
49

Description

**Ktor Version and Engine Used (client or server and name)**
1.2.2, server, Kotlin 1.3.41

**Describe the bug**
Auto-reload works for the primary module with ktor in it, but won't work for dependency modules, even though I've included the paths to those modules in the watch paths.

**To Reproduce**
I have 5 server modules:
```
/root
/server
/edge - module with ktor and the JVM main. Depends on controller and model directly
/controller - depends on data and model module directly
/data - depends on persist and model module directly
/persist
/model
```

The `:server:edge` module has the gradle `application` plugin attached, and I'm setting the working directory for it to root.
```
tasks.getByName("run") {
workingDir = rootDir
}
```

The server is set to watch the paths of all 5 server modules. When the server is running and I do a build for the `edge` module, changes for the `edge` module are updated without an application restart. Changes for other modules are not updated. I have to stop the server, and run it again to get changes in other modules.

**Expected behavior**
When a dependency is updated - auto reload would work for that module as well if it's path is set in the `watchPaths` list.

**This is for a private project. I can invite someone to the private project if need be.**

Contributor guide

Open the contributing guide

Research direction

Start with the server's watchPaths configuration and the :server:edge Gradle run task, then reproduce the five-module setup by changing edge and a dependency module. Trace why a rebuild updates edge without restarting for dependency changes. Done means changes in every watched module are applied without stopping and restarting the server.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
backend, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.