feat(support): user issue reporting (endpoint + web dialog) - #943
Open
Rasbandit wants to merge 9 commits into
Open
feat(support): user issue reporting (endpoint + web dialog)#943Rasbandit wants to merge 9 commits into
Rasbandit wants to merge 9 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds Engram.Notifications.Discord (pure build_report_payload/2 + fire-and-forget notify_report/2, Task.start so a slow/failing Discord never blocks a report submit). Reads DISCORD_WEBHOOK_URL in runtime config, top-level guarded so self-host/dev/test no-op. Wires notify_report into Support.create_report/3 after insert.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds useReportBug() mutation (mirrors useUpdateProfile), a ReportBugDialog (controlled Dialog + plain textarea, no shadcn textarea exists), and a ReportBugSection mounted before DangerZoneSection on the account settings page.
Report-bug dialog used a divergent Tailwind string for its textarea, making it render inconsistently with sibling settings inputs (email-section, password-section, danger-zone-section, delete-vault-dialog, active-vaults-section). Adopt the shared idiom. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- build_report_payload/2 now returns allowed_mentions: %{parse: []}
so Discord will not resolve @everyone/@here/role mentions embedded
in user-controlled report.description. Without this, any
authenticated user could ping the whole ops server via a bug report.
- ellipsis/1 now compares String.length (graphemes) instead of
byte_size, matching the grapheme-based String.slice truncation used
to build the content. Previously a multibyte-heavy description under
@desc_limit graphemes but over @desc_limit bytes would be left
unchanged by the slice yet still get a trailing "…" appended.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User issue reporting — backend endpoint + web dialog
Lets users report issues from the web app (and, via the paired plugin PR, from Obsidian). Reports are stored in Postgres keyed to the user + a timestamp, and a Discord webhook pings on each new report. Logs/traces are not copied:
user_id+inserted_atis the pointer into Loki/Tempo.What's here
issue_reportstable +Engram.Support.create_report/3. Server-stampsuser_id/vault_id/device_fingerprint; RLS-allowlisted (founder cross-tenant triage, no per-user read path).Engram.Notifications.Discord— fire-and-forget webhook (Task.start), no-ops whenDISCORD_WEBHOOK_URLis unset (self-host/dev), carries a ±10 min LogQL window. Guarded withallowed_mentions: %{parse: []}so a report body cannot smuggle@everyone.POST /api/reportson the auth-but-not-onboarding scope (onboarding/billing-blocked users can still report), rate-limited 5/hr/user. Addedreportsto the host_rewrite@api_top_segmentsallowlist (would otherwise silent-404 in prod).Verification
mix format,credo --strict0,sobelow --exit,mix test3502/0.user_id, 12-chardevice_fingerprint, best-effortvault_idfromX-Vault-ID,status="open".Follow-ups (deferred, non-blocking)
DISCORD_WEBHOOK_URLSOPS secret in engram-infra for prod (feature no-ops safely until then).app_versionlength cap; server-side description trim; rate-limit-before-validation ordering.Paired with the plugin PR (report-issue command + modal) — engram-app/Engram-obsidian#192.
🤖 Generated with Claude Code