feat(outbound): add glucodroid.cloud destination preset - #38
Conversation
|
| Filename | Overview |
|---|---|
| Common/src/main/java/tk/glucodata/OutboundApiSettings.kt | Adds Uri.encode() for the ingest token in resolvedUrl(), and wires glucodroid_cloud into createDestination with minIntervalMinutes=0. decodeDestinations still falls back to DEFAULT_MIN_INTERVAL_MINUTES (5) for glucodroid_cloud when the field is absent from stored JSON. |
| Common/src/mobile/java/tk/glucodata/ui/OutboundApiSettingsScreen.kt | Moves the glucodroid subdomain field above the shared token field and gates URL/headers/template fields behind !isGlucodroid; field ordering and visibility are now correct. |
Sequence Diagram
sequenceDiagram
participant UI as OutboundApiSettingsScreen
participant Settings as OutboundApiSettings
participant Server as glucodroid.cloud
UI->>Settings: createDestination(PRESET_GLUCODROID_CLOUD)
Settings-->>UI: "Destination(url="", token="", minIntervalMinutes=0)"
UI->>UI: "User enters subdomain → destination.copy(url=subdomain.trim())"
UI->>UI: "User enters token → destination.copy(token=token)"
UI->>Settings: save(config)
UI->>Settings: resolvedUrl()
Settings->>Settings: Uri.encode(token.trim())
Settings-->>UI: "https://{subdomain}.glucodroid.cloud/api/v1/ingest?token={encoded}"
UI->>Server: POST resolvedUrl()
Server-->>UI: 200 OK
UI->>Settings: withPreset(otherPreset)
Note over Settings: oldPreset==PRESET_GLUCODROID_CLOUD → url reset to defaultUrl(newPreset)
Reviews (3): Last reviewed commit: "fix(outbound): URL-encode token in gluco..." | Re-trigger Greptile
…in before token - Uri.encode() the ingest token so characters like +, &, =, # in base64-style tokens don't produce malformed query strings. - Move the subdomain field above the token field in the UI so the order matches the URL shape (subdomain → token) and users fill in the account identifier first. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53a8091 to
4e6a6c3
Compare
Summary
Adds a first-class
glucodroid.cloudpreset to the outbound API destination picker.https://{subdomain}.glucodroid.cloud/api/v1/ingest?token=…minIntervalMinutesdefaults to 0 (the cloud service handles its own deduplication)Test plan
https://<subdomain>.glucodroid.cloud/api/v1/ingest?token=<token>🤖 Generated with Claude Code