fix(accounts): gitea_notifications, gitea_user_search and org members dump raw JSON #33
Labels
No labels
area/dsh
area/forgejo
experiment
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-gitea#33
Loading…
Reference in a new issue
No description provided.
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?
Symptom
Three everyday account reads dump raw JSON instead of a readable list:
gitea_notifications,gitea_user_search, andgitea_org action:"members". Notifications are especially noisy — five rows expand to >1.5 KB of clipped JSON.Repro
Observed vs expected
dsh (https://git.pvlb.dev/dsh)per line; observed JSON.Root cause
lib/handlers/formatters.jsgeneric array/object fallbacks: notification rows have nonumber/path/name, user rows have none of those either (loginis only handled for single objects viaif (data.login)), soclipSnippet/describeUnknownObjectemits JSON.gitea_user_search's tool description says "Search users"; a bare login is enough.Proposed fix
Add formatters:
gitea_notifications:unreadmarker,repo/issue #N title, reason/type, updated_at.gitea_user_search/gitea_org members:login (html_url)orlogin — full_name.Tests with the recorded payloads/caps. Acceptance: none of the three ever prints raw JSON for a normal response.
Duplicate check
Searched
notifications/user(state all) — no existing issue; #5 covered empty/bare-OK, not these shapes.Layer
dsh-gitea plugin/tool (formatter).
Fixed in
56f41de(PR #41).• repo — subject [type, reason] (updated)with an unread marker.login (name) — url.loginper line.subject,reasonandunreadwere added toRECORD_KEYS— they were being stripped before formatting.Live: notifications/users/org members all render as readable lists.
Tests:
test/qa-formatters.test.mjs.