File Search worker finds no work when the database user has neither superuser nor BYPASSRLS
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- postgresql, typescript
调研方向
Start with FileSearchRepository.withTenant and the worker's cross-workspace queries: scheduler lease claim, extend and release, the share sweep, and closing interrupted runs (#1417), none of which set app.current_org. Check the existing org_isolation policies on the file_* tables, then add a migration with a maintenance switch such as app.files_maintenance. Done means the worker finds work and sweeps shares under a non-superuser role without BYPASSRLS, covered by an integration test modeled on the #1395 CREATEROLE check.
由索引模型根据 Issue 内容生成。
描述
Problem
The file_* tables use FORCE ROW LEVEL SECURITY; tenant queries go through FileSearchRepository.withTenant (app.current_org, optionally SET LOCAL ROLE amcp_files). The worker's cross-workspace maintenance queries do not set app.current_org:
- scheduler lease claim, extend and release;
- share sweep;
- closing interrupted runs (#1417).
They rely on the application user bypassing RLS: superuser, which is the case on AnythingMCP Cloud and in the default Docker Compose setup.
On a self-hosted install whose application user is neither superuser nor BYPASSRLS (some managed PostgreSQL offerings), those queries see no rows. Syncs then never start, and expired share files are not swept. Nothing errors.
Proposal
- A new migration extends the
org_isolationpolicies with an explicit maintenance switch, for exampleOR current_setting('app.files_maintenance', true) = 'on'. - The worker's cross-workspace queries run inside a transaction with
set_config('app.files_maintenance', 'on', true). - Add an integration test as a non-superuser role, like the one used for #1395's CREATEROLE check.
Found while hardening File Search on 2026-11-01. Relates to #1379, #1380, #1383.
- 主要语言
- TypeScript
- 星标
- 856
- 派生
- 82
- 平均合并
- 6 小时 43 分钟
- 30 天内合并 PR
- 399
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
HelpCode-ai/anythingmcp 的其他 Issue
-
adapter-request good first issue help wanted
难度 2/5 1-3 小时 新手友好度 72/100
HelpCode-ai/anythingmcp#1405 ·
维护者通常 1 天内回复
-
Upload the new social preview可能已有人在做 @helpcodeai 于 1 天前认领。 未关闭
HelpCode-ai/anythingmcp#1455 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Adapter: TGStat未关闭adapter-request good first issue help wanted
难度 3/5 1-2 天 新手友好度 75/100
HelpCode-ai/anythingmcp#1413 ·
维护者通常 1 天内回复
-
adapter-request good first issue help wanted
难度 3/5 1-2 天 新手友好度 72/100
HelpCode-ai/anythingmcp#1412 · 2 条评论 ·
维护者通常 1 天内回复
-
adapter-request good first issue help wanted
难度 3/5 1-2 天 新手友好度 70/100
HelpCode-ai/anythingmcp#1411 ·
维护者通常 1 天内回复
查看 HelpCode-ai/anythingmcp 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
formbricks/formbricks#9918 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
thecodacus/pithagoras#364 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 72/100
openclimatefix/quartz-frontend#823 ·
维护者通常 4 天内回复
-
area:agent-manager community needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
`contacts.create` posts to `/audiences/undefined/contacts` when `audienceId` is undefined可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
resend/resend-node#1176 ·
维护者通常 1 天内回复