[Bug]: Optional-auth queries never send authorization, so `viewer` is always missing even with an active session

未关闭 适合新手
#352 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
swift
领域
api

调研方向

从 searchActors(matching:limit:cursor:) 开始,并将其请求设置与 issue 中提到的可选身份验证方法进行比较:getAuthorFeed、getListFeed、searchStarterPacks 和 getLabelerServices。检查如何使用 getUserSession() 附加授权信息,同时仍允许未认证的请求。完成标准是:对于有活动会话的已关注账号,viewer 已填充,并且这些查询在没有会话时仍可正常运行。

由索引模型根据 Issue 内容生成。

描述

bug
Summary

searchActors(matching:limit:cursor:) always sends its request to self.pdsURL without authorization, even when a user session exists, so viewer is always missing on the returned actors. Other optional-auth methods such as getAuthorFeed, getListFeed, searchStarterPacks, and getLabelerServices have the same problem.

Reproduction Steps
  1. Sign in with ATProtoKit so that getUserSession() returns a session.
  2. Call searchActors(matching:) with a query that matches an account the signed-in user follows.
  3. Inspect viewer on the returned actors.
Expected Results

viewer is populated (e.g. viewer.followingURI for followed accounts).

Actual Results

viewer is nil for every actor.

What operating systems did you experience this bug?

macOS

Operating System Version

macOS Golden Gate 27.2.1

ATProtoKit Version

0.34.1

Additional Context

The lexicons state "Does not require auth," which permits unauthenticated calls but does not preclude authenticated ones.

主要语言
Swift
星标
226
派生
40
平均合并
2 小时 56 分钟
30 天内合并 PR
3

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MasterJ93/ATProtoKit 的其他 Issue

查看 MasterJ93/ATProtoKit 的全部 Issue

相似的 Issue

更多 Swift Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。