The signup API accepts `organizerDisplayName`, but nothing stores or reads it

Đang mở Phù hợp với người mới
#794 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
74/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
api, backend

Hướng nghiên cứu

Đọc src/schemas/signups.ts và src/mcp/tools/signups-write.ts, sau đó kiểm tra các bài kiểm thử liên quan, đặc biệt là src/mcp/tools/signups-write.test.ts. Xóa phần xử lý organizerDisplayName không được sử dụng, đồng thời giữ nguyên hành vi loại bỏ visibility hiện có và cập nhật chú thích của hành vi đó. Hoàn tất khi khóa này không còn xuất hiện trong src và các bước kiểm tra lint, định dạng, kiểu, knip và kiểm thử được liệt kê đều đạt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

What happens

SignupCreateInputSchema in src/schemas/signups.ts accepts organizerDisplayName (a NameSchema), and SignupUpdateInputSchema inherits it. Nothing else in the repo uses it. There's no column for it, and createSignup and updateSignup never write it. No screen, email, help page, doc or test sends or reads it. The only other mention is in update_signup (src/mcp/tools/signups-write.ts), which .omits it, with a comment saying no column stores it.

So a REST create or update with a valid value is quietly dropped. A blank, non-string or over-100-character value is refused with a 400 on a field that does nothing.

Open issue #584 (a signup's page gives no way to reach its organizer) already notes this. Whether to delete the key or build on it for #584 is your call, so this is held back.

Fix, in outline (if deleting)

  • src/schemas/signups.ts: remove the organizerDisplayName line, and drop NameSchema from that file's import if nothing else there uses it.
  • src/mcp/tools/signups-write.ts: remove organizerDisplayName: true from the .omit, and reword the comment to cover visibility only.
  • Test: a schema test that the key is stripped from parsed input.

Watch for

  • Fewer refusals. Both schemas strip unknown keys. After the change, a REST request carrying a bad organizerDisplayName succeeds instead of getting a 400. Nothing that succeeds today starts failing. Say so in the PR.
  • The activity log loses the key. signup.updated records changed: Object.keys(data), so an update that sends the key today lists it in changed, and afterwards won't. No code reads changed.
  • The MCP comment is also wrong about visibility. It says accepting visibility "would report a change that never happened". In fact the update schema refuses visibility, and the .omit turns that refusal into a silent strip. src/mcp/tools/signups-write.test.ts pins the strip, so keep the behaviour and only make the comment accurate.

Done when

  • organizerDisplayName appears nowhere in src.
  • pnpm lint && pnpm format:check && pnpm typecheck && pnpm knip && pnpm test pass.

Found by the pipeline's refactor scout in the MCP tools and signup schemas (src/mcp/tools, src/schemas/signups.ts), at be0c273. Checked by an independent verify agent: a whole-repo grep, plus a scratch vitest parse of both schemas with and without the key. https://claude.ai/code/session_016YZ9SS4Qrr2sRQj4bhaMwW

Held back by the scout's cap. Add pipeline:ready to queue it.

Ngôn ngữ chính
TypeScript
Star
19
Fork
4
Merge trung bình
19 giờ 38 phút
Pull request đã merge (30 ngày)
197

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của richshaw/OpenSignup

Tất cả issue của richshaw/OpenSignup

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.