-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
monument/src/main/kotlin/de/skyrising/guardian/gen/files.kt
Lines 17 to 21 in a29e1a8
| private val DOWNLOADS = ConcurrentHashMap<URI, CompletableFuture<Unit>>() | |
| fun download(url: URI, file: Path, listener: ((DownloadProgress) -> Unit)? = null) = DOWNLOADS.computeIfAbsent(url) { | |
| startDownload(it, file, listener) | |
| } |
Issue at: DOWNLOADS.computeIfAbsent(url) ignores the file parameter
To reproduce
- Define a branch container both mc 1.20.3 and mc 1.20.4, using mojang mapping
- Run the monument
Expected behavior
Both mc 1.20.3 and mc 1.20.4 have their mojang mapping.txt downloaded successfully
Actual behavior
Only the first download attempts to the mapping.txt will succeed
Reason: mc1.20.3 and mc1.20.4 use the same mapping.txt, causing the issue that the later download attempt will be skipped (due to the computeIfAbsent) call
More information on the same server_mappings and client_mappings:
- https://github.com/skyrising/mc-versions/blob/351a09651cc4c8019a7d46c956b55369e6e5675e/data/version/1.20.3.json#L4-L25
- https://github.com/skyrising/mc-versions/blob/351a09651cc4c8019a7d46c956b55369e6e5675e/data/version/1.20.4.json#L4-L24
Example fix
private val DOWNLOADS = ConcurrentHashMap<Pair<URI, Path>, CompletableFuture<Unit>>()Metadata
Metadata
Assignees
Labels
No labels