bug: app slack/ntfy settings are not saved or properly displayed on edit #157

Closed
opened 2026-03-06 12:36:23 +01:00 by sneak · 2 comments
Owner

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

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
sneak added the bot label 2026-03-06 12:36:23 +01:00
Author
Owner

maybe it's not being properly saved on app creation - that could be the issue

maybe it's not being properly saved on app creation - that could be the issue
Collaborator

Investigation Findings

Traced the full flow for slack/ntfy notification settings:

  1. Database schema (001_initial.sql): Has ntfy_topic TEXT and slack_webhook TEXT columns.
  2. Model (models/app.go): Has NtfyTopic and SlackWebhook as sql.NullString fields, included in insert(), update(), and scan().
  3. Service (service/app/app.go): CreateAppInput has NtfyTopic and SlackWebhook fields, and CreateApp correctly sets them on the model.
  4. Edit template (app_edit.html): Form fields with names ntfy_topic and slack_webhook, values rendered with {{if .App.NtfyTopic.Valid}}{{.App.NtfyTopic.String}}{{end}}.
  5. Edit handler (HandleAppEdit): Loads full app via FindApp and passes it to template.
  6. Update handler (HandleAppUpdate): Reads form values and saves them.
  7. Create handler (HandleAppCreate): ⚠️ BUG FOUND — Does NOT read ntfy_topic, slack_webhook, or docker_network from the form, even though app_new.html has these fields and CreateAppInput supports them.

Root Cause

HandleAppCreate only 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, and slack_webhook form values in HandleAppCreate, passing them to CreateAppInput and including them in the template re-render data for validation error cases.

## Investigation Findings Traced the full flow for slack/ntfy notification settings: 1. **Database schema** (`001_initial.sql`): Has `ntfy_topic TEXT` and `slack_webhook TEXT` columns. ✅ 2. **Model** (`models/app.go`): Has `NtfyTopic` and `SlackWebhook` as `sql.NullString` fields, included in `insert()`, `update()`, and `scan()`. ✅ 3. **Service** (`service/app/app.go`): `CreateAppInput` has `NtfyTopic` and `SlackWebhook` fields, and `CreateApp` correctly sets them on the model. ✅ 4. **Edit template** (`app_edit.html`): Form fields with names `ntfy_topic` and `slack_webhook`, values rendered with `{{if .App.NtfyTopic.Valid}}{{.App.NtfyTopic.String}}{{end}}`. ✅ 5. **Edit handler** (`HandleAppEdit`): Loads full app via `FindApp` and passes it to template. ✅ 6. **Update handler** (`HandleAppUpdate`): Reads form values and saves them. ✅ 7. **Create handler** (`HandleAppCreate`): ⚠️ **BUG FOUND** — Does NOT read `ntfy_topic`, `slack_webhook`, or `docker_network` from the form, even though `app_new.html` has these fields and `CreateAppInput` supports them. ### Root Cause `HandleAppCreate` only 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`, and `slack_webhook` form values in `HandleAppCreate`, passing them to `CreateAppInput` and including them in the template re-render data for validation error cases. <!-- session: agent:sdlc-manager:subagent:1fb3582d-1eff-4309-b166-df5046a1b885 -->
sneak closed this issue 2026-03-10 01:01:33 +01:00
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/upaas#157