Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

fix(tenants): 停用租户不停运行时——status 只在 switch_tenant 一处生效,已签发会话/调度/挂起 resume 全部不受影响

Open
#27 18 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python, redis, sqlite

Research direction

Start with tenants_svc.py:set_tenant_status, users_svc.py:resolve_session and switch_tenant, auth.py, schedule_service.py:fire_schedule, and the worker _dispatch_task entry point. Trace how tenant status is read across sessions, schedule dispatch, and resume handling; done means signed sessions receive 403 after deactivation and the tenant's schedules are no longer enqueued.

Written by the indexing model from the issue text.

Description

场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:无

基线 HEAD = ddcedae。

Summary

tenants_svc.py:85-93 set_tenant_status 只改 SQLite 行。全仓唯一检查点是 users_svc.py:234-235(switch_tenant 内 tenant.status != "active" 拦截)。三个运行面都不查:

  1. users_svc.py:186-221 resolve_session 不查 Tenant.status——已签发的 7 天会话在租户停用后继续全权访问;auth.py:53-117 同样不查;
  2. server/services/schedule_service.py:80-108 fire_schedule 从 Redis HASH 派发,不查租户状态——停用租户的 cron 继续入队执行;
  3. worker 恢复挂起执行也无租户状态闸。

影响

「停用租户」对运行面是 no-op:封禁/欠费租户的已登录用户继续读写数据、调度继续跑、挂起 run 继续 resume——只影响下次手动切换租户。

建议

resolve_session、worker _dispatch_task、fire_schedule 三处加租户状态闸(worker 可缓存租户状态于 Redis 短 TTL);停用时批量撤销该租户会话并禁用其 schedules。

验收:停用租户后,其已签发会话的 API 调用返回 403;其 schedule 不再入队。

Dominant language
Python
Stars
0
Forks
1
Avg merge
3h 53m
Merged PRs (30d)
3

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jeffkit/plaita

All issues in jeffkit/plaita

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.