bug: app slack/ntfy settings are not saved or properly displayed on edit #157
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
please investigate why these settings would either not be getting saved, or would not show up on the edit page fields when the app is being edited.
@clawbot
maybe it's not being properly saved on app creation - that could be the issue
Investigation Findings
Traced the full flow for slack/ntfy notification settings:
001_initial.sql): Hasntfy_topic TEXTandslack_webhook TEXTcolumns. ✅models/app.go): HasNtfyTopicandSlackWebhookassql.NullStringfields, included ininsert(),update(), andscan(). ✅service/app/app.go):CreateAppInputhasNtfyTopicandSlackWebhookfields, andCreateAppcorrectly sets them on the model. ✅app_edit.html): Form fields with namesntfy_topicandslack_webhook, values rendered with{{if .App.NtfyTopic.Valid}}{{.App.NtfyTopic.String}}{{end}}. ✅HandleAppEdit): Loads full app viaFindAppand passes it to template. ✅HandleAppUpdate): Reads form values and saves them. ✅HandleAppCreate): ⚠️ BUG FOUND — Does NOT readntfy_topic,slack_webhook, ordocker_networkfrom the form, even thoughapp_new.htmlhas these fields andCreateAppInputsupports them.Root Cause
HandleAppCreateonly read four form values (name,repo_url,branch,dockerfile_path) but ignored the three optional settings fields (docker_network,ntfy_topic,slack_webhook). When a user filled in notification settings during app creation, they were silently discarded. The edit/update flow was actually correct — the bug was exclusively in the create path.This explains the reported behavior: settings entered during creation would not appear on the edit page because they were never saved to the database.
Fix
Added reading of
docker_network,ntfy_topic, andslack_webhookform values inHandleAppCreate, passing them toCreateAppInputand including them in the template re-render data for validation error cases.