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:
2026-10-12 11:08:56 +09:00
parent c07a3466a0
commit 89ad338024
29 changed files with 1849 additions and 378 deletions
+7 -2
View File
@@ -27,6 +27,10 @@ class FakeStore(MagicMock):
def is_member(self, project_id, user_email):
return user_email in self.MEMBERS.get(int(project_id), set())
def list_projects(self, include_archived=False, member_email=None):
return [{"id": pid, "parent_id": None} for pid, ms in self.MEMBERS.items()
if member_email is None or member_email in ms]
def get_project(self, project_id):
return {"id": project_id, "name": "P1", "owner_email": "admin@test.local", "created_by": "admin@test.local"}
@@ -145,6 +149,8 @@ class RoleApiTests(unittest.TestCase):
body = {"ordered_ids": [1]}
self.assertEqual(self.call(USER, "PUT", "/project/api/projects/order", json=body).status_code, 403)
self.assertEqual(self.call(PRO, "PUT", "/project/api/projects/order", json=body).status_code, 200)
# Pro user 라도 멤버가 아닌 프로젝트는 순서를 못 바꾼다(검토 2026-10-12)
self.assertEqual(self.call(OUTSIDER_PRO, "PUT", "/project/api/projects/order", json=body).status_code, 403)
def test_section_delete_admin_any_others_creator(self):
self.assertEqual(self.call(PRO, "DELETE", "/project/api/projects/1/stages/5").status_code, 403)
@@ -173,8 +179,7 @@ class RoleApiTests(unittest.TestCase):
self.assertEqual(self.call(PRO, "GET", "/project/api/projects/1/subtasks-summary").status_code, 200)
def test_trash_restore_pro(self):
self.st.list_trash.return_value = [{"id": 4, "project_id": 1}]
self.st.list_projects.return_value = [{"id": 1}]
self.st.list_trash.return_value = [{"id": 4, "project_id": 1}] # 프로젝트 1 = PRO 가 멤버(list_projects)
self.st.restore_trash.return_value = {"restored": 1}
self.assertEqual(self.call(USER, "POST", "/project/api/trash/4/restore").status_code, 403)
self.assertEqual(self.call(PRO, "POST", "/project/api/trash/4/restore").status_code, 200)