web-api: type-safe response properties access
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
- 领域
- api
调研方向
使用 @slack/bolt 3.12.2 重现报告中的 TypeScript 示例,然后跟踪 app.client.users.info 的响应类型及其 user 属性。完成的标准是:成功的响应可以在无需进行不必要的 undefined 检查的情况下访问其属性,并且覆盖报告中的访问模式。
由索引模型根据 Issue 内容生成。
描述
What type of issue is this? (place an x in one of the [ ])
- bug
Requirements (place an x in each of the [ ])
- I've read and understood the Contributing guidelines and have done my best effort to follow them.
- I've read and agree to the Code of Conduct.
- I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
const slackUser = await app.client.users.info({
user: installation.user.id,
})
slackUser.user.name // Object `user` is possibly 'undefined'.
If there was an error here, the function would throw an error and we could catch it somewhere else. It's confusing me and should be a bug that we can't safely access properties after a function is called with no errors.
Should we be having to use if {} else {} to safely access these properties?
Reproducible in:
package version: "@slack/bolt": "^3.12.2",
- 主要语言
- TypeScript
- 星标
- 3.4k
- 派生
- 693
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 67
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
slackapi/node-slack-sdk 的其他 Issue
-
auto-triage-skip enhancement pkg:web-api
难度 2/5 1-3 小时 新手友好度 68/100
slackapi/node-slack-sdk#2607 · 2 条评论 · 2 个 reaction ·
维护者通常 1 天内回复
-
`SlackListsItem FieldMessage.message` type does not match API response shape可能已有人在做 @AjTheSpidey 于 202 天前认领。 未关闭area:typescript auto-triage-skip bug pkg:web-api
难度 2/5 1-3 小时 新手友好度 82/100
slackapi/node-slack-sdk#2598 · 2 条评论 ·
维护者通常 1 天内回复
-
Missing TypeScript response type for files.uploadV2可能已有人在做 @Yshuro 于 6 天前认领。 未关闭area:typescript auto-triage-skip bug pkg:web-api
难度 2/5 1-3 小时 新手友好度 66/100
slackapi/node-slack-sdk#2459 · 2 条评论 ·
维护者通常 1 天内回复
-
Docs/types: document `broadcast_delete` on chat.delete (undo reply_broadcast)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭area:typescript enhancement pkg:web-api semver:patch
难度 5/5 一周以上 新手友好度 25/100
slackapi/node-slack-sdk#2815 · 1 条评论 ·
维护者通常 1 天内回复
-
auto-triage-stale
难度 3/5 1-2 天 新手友好度 75/100
slackapi/node-slack-sdk#2791 · 1 条评论 ·
维护者通常 1 天内回复
查看 slackapi/node-slack-sdk 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
agilepathway/label-checker#1015 · 2 条评论 ·
维护者通常 1 天内回复
-
tech-debt
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug P3
难度 1/5 1 小时以内 新手友好度 89/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
react-component/image#541 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复