Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Org scoped searches disagree on what a deleted organization means

未关闭
#1,956 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
go
领域
api, backend, database

调研方向

Trace the handlers and aggregate services for the invoice and token RPCs first to find where their 404 responses originate, then compare that path with the other org-scoped searches and OrganizationRepository.Delete. Make every listed search resolve the organization consistently and return 404 when absent while retaining the SQL live(organizations) checks; verify the behavior for all affected RPCs.

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

描述

The problem

Asking an org scoped search about an organization that is gone gives different answers depending on which RPC you call. A client cannot tell "this organization does not exist" apart from "this organization has nothing to show".

We want 404 not found everywhere.

Where things stand today

Verified by reading the handlers and services:

RPC Today How
SearchOrganizationServiceUsers 404 The handler calls orgService.GetRaw first, which reads live rows only
SearchOrganizationUsers 200, empty list After #1953 the SQL filters the organization out
SearchOrganizationProjects 200, empty list After #1953 the SQL filters the organization out
SearchUserProjects 200, empty list After #1953 the SQL filters the organization out
SearchOrganizationPATs 200, with rows No check anywhere. See the comment on #1953
SearchOrganizationInvoices 404 Needs confirming, see below
SearchOrganizationTokens 404 Needs confirming, see below

The end to end run in #1952 reported 404 for invoices and tokens. But neither handler nor either aggregate service resolves the organization. So something upstream is doing it, and part of this work is finding out what. If it turns out to be a shared path, that path may be the right place to fix all of them at once.

What to do

  1. Find out where the 404 for invoices and tokens comes from.
  2. Pick one way for every org scoped search to resolve the organization before running the query, and answer 404 when it is not there. Reuse whatever invoices and tokens already go through if that turns out to be shared.
  3. Apply it to SearchOrganizationUsers, SearchOrganizationProjects, SearchUserProjects and SearchOrganizationPATs.
  4. Keep the SQL level live(organizations) checks from #1953 as well. They are cheap and they guard the case where a policy row outlives its organization. policies.resource_id has no foreign key to organizations, so a hard deleted organization does leave membership policies behind.

Why it matters

Today OrganizationRepository.Delete is a hard delete and nothing sets deleted_at on organizations, so the split is mostly invisible. It will stop being invisible the moment organizations get a soft delete. Better to settle it now while the blast radius is small.

Related

  • #1953 added the SQL level checks for three of these searches
  • #1952 changed how a bad organization id is reported, which is what surfaced the split
主要语言
Go
星标
344
派生
47
平均合并
2 天 20 小时
30 天内合并 PR
39

环境准备

我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

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

raystack/frontier 的其他 Issue

查看 raystack/frontier 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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