🎙️ task - fix(repo): coerce empty-string homepage/description to null (perpetual UPDATE drift)
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
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- github, typescript
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Bắt đầu trong src/domain.operations/repo/castToDeclaredGithubRepo.ts, tại các cast của homepage và description ở dòng 47-48. Đồng thời kiểm tra setRepo để xác định xem có cần áp dụng cùng một bước chuẩn hóa ở đó hay không. Xác minh bản sửa lỗi bằng kịch bản plan, apply và re-plan đã được báo cáo, xác nhận rằng các giá trị null hội tụ mà không bị UPDATE drift liên tục.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🦫🎙️ dispatch to foreman
💧 task enqueued
├─ priority = ?
├─ yieldage = ?
└─ leverage = ?
title
fix(repo): coerce empty-string homepage/description to null (perpetual UPDATE drift)
description
.what
castToDeclaredGithubRepo casts an empty-string homepage (and description) from the GitHub API to an empty string, but the natural desired value is null. The two never converge, so every declastruct plan on a DeclaredGithubRepo shows a homepage empty-string to null UPDATE, and every apply is a no-op that re-stores the empty string. The resource is never idempotent.
.where
src/domain.operations/repo/castToDeclaredGithubRepo.ts (main / 1.7.0)
description: input.description ?? null, // line 47
homepage: input.homepage ?? null, // line 48
.root-cause
GitHub's REST API returns homepage and description as an empty string for repos with no homepage/description set — NOT null. the ?? null coalesce only fires on null/undefined, so an empty string stays an empty string.
- remote casts to
homepage= empty string - a natural wish declares
homepage: null(there is no homepage) - empty string is not equal to null, so declastruct decides UPDATE, forever
.repro
- declare a
DeclaredGithubRepowithhomepage: null(repo has no homepage set on github) declastruct plan-> showshomepageempty-string vs null UPDATEdeclastruct apply-> no-op (github stores empty string again)- re-plan -> same UPDATE. never converges.
observed on ahbode/infrastructure provision/github.repo at declastruct-github 1.6.0; confirmed unchanged on main (1.7.0).
.fix
coerce empty string to null in the cast, so remote matches a null wish:
description: input.description || null, // empty string -> null
homepage: input.homepage || null, // empty string -> null
(|| null is safe here — both fields are free-text where empty string and "unset" are equivalent; there is no meaningful empty-string value to preserve.)
alternatively, if you prefer to keep ?? semantics elsewhere, an explicit input.homepage?.trim() || null also handles whitespace-only values.
.also-consider
whichever coercion you choose, apply it symmetrically on the SET side (setRepo) if it sends homepage/description, so a null wish is written consistently and a round-trip get -> cast -> set is stable.
.impact
- breaks idempotency guarantee for
DeclaredGithubRepo(always dirty) - noise in every plan; erodes trust in the KEEP vs UPDATE signal
- forces consumers to declare
homepageas an empty string (matching the buggy cast) as a workaround, which is backwards
- Ngôn ngữ chính
- TypeScript
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ehmpathy/declastruct-github
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 42/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
Tất cả issue của ehmpathy/declastruct-github
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
feat(icons): add [solidping]Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
homarr-labs/dashboard-icons#2939 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Agent/category reasoning variants are still checked against the stale model cache in chat.paramsĐang mởopencode
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
code-yeongyu/oh-my-openagent#10003 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Actions on ToastsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
nextcloud-libraries/nextcloud-dialogs#2669 ·
Maintainer thường phản hồi trong vòng 1 ngày