nandi/frqpublic Fork 0
3ee0b5b
Commits
Clone
git clone https://git.rickub.com/nandi/frq.git
git clone ssh://git@rickub.com/nandi/frq.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Type the upload's HttpClient so the compiler stops guessing

`defonce` and `await` both hand back dynamic, so every member call in
frq.upload.dart went out as a dynamic warning. Three hints cover all
twelve.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-12T07:34:12-07:00 Browse files
3ee0b5b parent: 6665ec6
modified flutter/src/frq/upload/dart.cljd +3 -3
@@ -9,7 +9,7 @@
99 ["dart:convert" :as conv]
1010 [frq.upload.core :as core]))
1111
12-(defonce ^:private client (io/HttpClient))
12+(defonce ^:private ^io/HttpClient client (io/HttpClient))
1313
1414 (defn ^:async upload!
1515 "Upload the file at `path` as `did`'s, answering the URL freeq serves it back
@@ -20,7 +20,7 @@
2020 {p :path ct :content-type body :body} (core/request did channel filename
2121 (vec bytes))
2222 uri (Uri.https host p)
23- req (await (.postUrl client uri))]
23+ ^io/HttpClientRequest req (await (.postUrl client uri))]
2424 (.set (.-headers req) "user-agent" "frq")
2525 (.set (.-headers req) "accept" "application/json")
2626 (.set (.-headers req) "content-type" ct)
@@ -33,7 +33,7 @@
3333 (let [out (io/BytesBuilder)]
3434 (doseq [b body] (.addByte out b))
3535 (.add req (.takeBytes out)))
36- (let [resp (await (.close req))
36+ (let [^io/HttpClientResponse resp (await (.close req))
3737 payload (await (.join (.transform resp (.-decoder conv/utf8))))
3838 status (.-statusCode resp)]
3939 (if (and (>= status 200) (< status 300))
@@ -9,7 +9,7 @@
9 ["dart:convert" :as conv]9 ["dart:convert" :as conv]
10 [frq.upload.core :as core]))10 [frq.upload.core :as core]))
11 11
12-(defonce ^:private client (io/HttpClient))12+(defonce ^:private ^io/HttpClient client (io/HttpClient))
13 13
14 (defn ^:async upload!14 (defn ^:async upload!
15 "Upload the file at `path` as `did`'s, answering the URL freeq serves it back15 "Upload the file at `path` as `did`'s, answering the URL freeq serves it back
@@ -20,7 +20,7 @@
20 {p :path ct :content-type body :body} (core/request did channel filename20 {p :path ct :content-type body :body} (core/request did channel filename
21 (vec bytes))21 (vec bytes))
22 uri (Uri.https host p)22 uri (Uri.https host p)
23- req (await (.postUrl client uri))]23+ ^io/HttpClientRequest req (await (.postUrl client uri))]
24 (.set (.-headers req) "user-agent" "frq")24 (.set (.-headers req) "user-agent" "frq")
25 (.set (.-headers req) "accept" "application/json")25 (.set (.-headers req) "accept" "application/json")
26 (.set (.-headers req) "content-type" ct)26 (.set (.-headers req) "content-type" ct)
@@ -33,7 +33,7 @@
33 (let [out (io/BytesBuilder)]33 (let [out (io/BytesBuilder)]
34 (doseq [b body] (.addByte out b))34 (doseq [b body] (.addByte out b))
35 (.add req (.takeBytes out)))35 (.add req (.takeBytes out)))
36- (let [resp (await (.close req))36+ (let [^io/HttpClientResponse resp (await (.close req))
37 payload (await (.join (.transform resp (.-decoder conv/utf8))))37 payload (await (.join (.transform resp (.-decoder conv/utf8))))
38 status (.-statusCode resp)]38 status (.-statusCode resp)]
39 (if (and (>= status 200) (< status 300))39 (if (and (>= status 200) (< status 300))