WIP: feat: Missing notification when another user comments on a post the user commented on #142

Draft
typosaurus wants to merge 5 commits from typosaurus/132-missing-notification-when-another-user-comments-on-a-post-th into master
Collaborator

Unfinished

This pull request is incomplete.

  • Verify PR #142 is open and mergeable — running

What was built

Summary

There is no notification sent when another user comments on a post that the current user has previously commented on.

Steps to Reproduce

  1. User A comments on a post.
  2. User B later comments on the same post.
  3. User A receives no notification about User B's comment.

Expected Behaviour

User A should be notified that someone else commented on a post they participated in (i.e. a post where they left a comment).

Actual Behaviour

No notification is sent.

Environment

Not provided.


Reported by D-04got10-01 via DevPlace.

Acceptance criteria

  • The ticket objective is satisfied: Missing notification when another user comments on a post the user commented on

Commits

Commit Summary Node
11b391d89280 feat(nadia): Fix: add participation notification type to the docs page table f6a3e757b755
9eb1cc6cfa1a test(sveta): Write test: admin page renders participation notification defaults row 950b129728bf
51a31395a416 test(sveta): Write API tests for participation notification 6b0969f5c2bb
1e1eb61b75f7 feat(nadia): Implement participation notification in comment creation 67dfba8421ba
101e3ebd93d7 feat(nadia): Register participation notification type 3bee27ba7937

Run

Cost: 0.1516 USD · Nodes: 15 · Verification: make test

Closes #132

## Unfinished This pull request is incomplete. - Verify PR #142 is open and mergeable — running ## What was built ## Summary There is no notification sent when another user comments on a post that the current user has previously commented on. ## Steps to Reproduce 1. User A comments on a post. 2. User B later comments on the same post. 3. User A receives no notification about User B's comment. ## Expected Behaviour User A should be notified that someone else commented on a post they participated in (i.e. a post where they left a comment). ## Actual Behaviour No notification is sent. ## Environment Not provided. --- *Reported by **D-04got10-01** via DevPlace.* ## Acceptance criteria - The ticket objective is satisfied: Missing notification when another user comments on a post the user commented on ## Commits | Commit | Summary | Node | |---|---|---| | `11b391d89280` | feat(nadia): Fix: add participation notification type to the docs page table | `f6a3e757b755` | | `9eb1cc6cfa1a` | test(sveta): Write test: admin page renders participation notification defaults row | `950b129728bf` | | `51a31395a416` | test(sveta): Write API tests for participation notification | `6b0969f5c2bb` | | `1e1eb61b75f7` | feat(nadia): Implement participation notification in comment creation | `67dfba8421ba` | | `101e3ebd93d7` | feat(nadia): Register participation notification type | `3bee27ba7937` | ## Run Cost: 0.1516 USD · Nodes: 15 · Verification: make test Closes #132
typosaurus added 3 commits 2026-07-27 00:06:44 +02:00
Outcome: done
Changed: devplacepy/docs_api/groups/profiles.py:428
Verified by: `python3 -m py_compile` passed for both touched files. Full `make test` cannot run — Python 3.11.2 lacks the project's >=3.12 requirement, blocking `dataset` install.
Findings:
- `devplacepy/database/notifications.py:15` — `NOTIFICATION_TYPES` already contains key=`"participation"` (alphabetically between `message` and `badge`).
- `devplacepy/docs_api/groups/profiles.py:428` — endpoint summary now lists `participation` (after `message`).
- `devplacepy/docs_api/groups/profiles.py:447` — field description already listed `participation` from prior change.
- `_NOTIFICATION_TYPE_KEYS` at notifications.py:28 is dynamic — no code change needed for `set_notification_pref` to accept the key.
Open: Full `make test` regression pass needs Python >=3.12 environment.
Confidence: high — both files compile cleanly; the `NOTIFICATION_TYPES` entry pre-existed; the docs-only string change has zero runtime effect.

Typosaurus-Run: 33c1c53eb8d34b528ee5beab574476fb
Typosaurus-Node: 3bee27ba793743d18ba15e7c83fdcb93
Typosaurus-Agent: @nadia
Refs: #132
**Outcome:** done
**Changed:** devplacepy/content.py:363-384
**Verified by:** `python3 -m py_compile devplacepy/content.py` passed, `python3 -m pyflakes devplacepy/content.py` clean
**Findings:**
- `devplacepy/content.py:363-384` — participation notification block inserted inside `if target_type == "post"`, after existing reply/comment notifications, before `create_mention_notifications`
- Logic: fetches post owner, queries distinct previous commenters, excludes self and post owner, calls `create_notification` for each
- Silencing handled automatically by `_deliver_notification` in `devplacepy/utils/notifications.py:103`
- `NOTIFICATION_TYPES` at `devplacepy/database/notifications.py:15` already contains `"participation"` key
- No new imports required; query uses existing `idx_comments_target` index
**Open:** Full `make test` regression pass needs Python >=3.12 environment
**Confidence:** high — compile and pyflakes both pass; minimal bounded addition following existing notification pattern; all preconditions verified before editing

Typosaurus-Run: 33c1c53eb8d34b528ee5beab574476fb
Typosaurus-Node: 67dfba8421ba47ea863bc2b87eb01cdd
Typosaurus-Agent: @nadia
Refs: #132
test(sveta): Write API tests for participation notification
Some checks failed
DevPlace CI / test (pull_request) Failing after 1h4m53s
b2c0342748
Outcome: done
Changed: tests/api/comments/notifications.py:1-263
Verified by: `python3 -m py_compile tests/api/comments/notifications.py` passed (exit 0, no warnings). Full `make test` cannot run — Python 3.11.2 lacks the project's >=3.12 requirement, blocking `dataset` install.
Findings:
- New test file `tests/api/comments/notifications.py` contains 4 test functions covering all acceptance criteria for the participation notification feature.
- `test_participation_notification_sent` — User A comments on a post, User B comments on same post, verifies User A has a `participation` notification with `"{b_name} also commented on this post"` message.
- `test_post_owner_no_participation_duplicate` — Post owner receives zero `participation` notifications but at least one `comment` notification, proving no duplicate.
- `test_commenter_no_self_notification` — User B receives zero `participation` notifications referencing their own username after commenting.
- `test_reply_triggers_participation` — A reply (comment with `parent_uid`) triggers participation notifications for other previous commenters (User A and User C) but not for the reply author (User B) or post owner.
- All tests follow the established pattern from `tests/api/comments/create.py` and `tests/api/notifications.py`: signup fresh users via HTTP, create posts/comments, query the `notifications` table via `refresh_snapshot()` + `get_table()`.
- Syntax verified clean; file contains no TODOs, placeholders, or stubs.
Open: Full

Typosaurus-Run: 33c1c53eb8d34b528ee5beab574476fb
Typosaurus-Node: 6b0969f5c2bb43c0979324b1b5c841b8
Typosaurus-Agent: @sveta
Refs: #132
typosaurus force-pushed typosaurus/132-missing-notification-when-another-user-comments-on-a-post-th from b2c0342748 to adb5def4da 2026-07-27 01:02:41 +02:00 Compare
typosaurus changed title from feat: Missing notification when another user comments on a post the user commented on to WIP: feat: Missing notification when another user comments on a post the user commented on 2026-07-27 01:02:42 +02:00
typosaurus force-pushed typosaurus/132-missing-notification-when-another-user-comments-on-a-post-th from adb5def4da to 11b391d892 2026-07-27 11:39:08 +02:00 Compare
typosaurus changed title from WIP: feat: Missing notification when another user comments on a post the user commented on to feat: Missing notification when another user comments on a post the user commented on 2026-07-27 11:39:09 +02:00
typosaurus closed this pull request 2026-07-27 11:41:11 +02:00
typosaurus reopened this pull request 2026-07-27 11:46:39 +02:00
typosaurus changed title from feat: Missing notification when another user comments on a post the user commented on to WIP: feat: Missing notification when another user comments on a post the user commented on 2026-07-27 11:47:38 +02:00
Some checks failed
DevPlace CI / test (pull_request) Failing after 1h21m43s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin typosaurus/132-missing-notification-when-another-user-comments-on-a-post-th:typosaurus/132-missing-notification-when-another-user-comments-on-a-post-th
git checkout typosaurus/132-missing-notification-when-another-user-comments-on-a-post-th
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: retoor/devplacepy#142
No description provided.