fix(project): review fixes — access leaks, open paths, save safety, concurrency
- Subproject tasks via parent /tasks are re-filtered by current access (FULL/READ kept)
- PUT /api/projects/order: every id must be manageable; bad/duplicate ids -> 400, all-or-nothing
- Inbox, web alert popup, PC notifier open tasks via /project/t/{id}; embed=1 survives redirect;
old /p/{home}?task= redirects READ users to the linked project
- Project page / snapshot / workload include the opened archived or sub project only
- Alerts: DB-side filters + oldest-first paging (no 50-row cut); badges counted without caps;
my tasks keep every open task (completed capped)
- Meeting results: next-week meeting open, or own meeting open when no next meeting;
header edits + result checks under row locks (FOR UPDATE / FOR SHARE)
- Inbox panel waits for the task window save (same retry/discard flow) before switching/closing;
read failures stay unread
- Attachment upload removes only its own file on DB failure
- New project modal: create once, retry only failed member assignments
- update_task / update_project: locked-row validation in one transaction; completion hints from real transition
- Creator added as explicit member when another owner is chosen
- _once lock lifetime managed by refcount (no leak on failure)
- Section default assignee must still be a registered project user; follower add uses can_assign
- Docs (PROJECT_MODULE 6-15, help), tests (DB-less, real PostgreSQL, jsdom, Chrome)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,10 @@ class FakeStore:
|
||||
def list_notifications(self, recipient_email, unread_only=False, limit=100):
|
||||
return ROWS[:limit]
|
||||
|
||||
def list_unread_after(self, recipient_email, after_id, types, limit=200):
|
||||
return sorted((r for r in ROWS if not r["is_read"] and r["id"] > after_id and r["type"] in types),
|
||||
key=lambda r: r["id"])[:limit]
|
||||
|
||||
def mark_read(self, notification_id, recipient_email):
|
||||
self.read.append((notification_id, recipient_email))
|
||||
|
||||
@@ -86,6 +90,8 @@ class NotifierApiTests(unittest.TestCase):
|
||||
out = res.json()
|
||||
self.assertEqual([a["id"] for a in out["alerts"]], [6, 8])
|
||||
self.assertEqual((out["me"], out["latest_id"], out["name"]), ("me@test.local", 8, "나"))
|
||||
# PC 알림 [열기] 도 웹과 같은 주소(작업 공유 링크) — 서버가 지금 권한으로 열 프로젝트를 고른다
|
||||
self.assertEqual([a["href"] for a in out["alerts"]], ["/project/t/3", "/project/t/1"])
|
||||
|
||||
def test_alerts_rejects_missing_or_unknown_token(self):
|
||||
self.assertEqual(self.client.get("/project/api/notifier/alerts").status_code, 401)
|
||||
|
||||
Reference in New Issue
Block a user