fix: enable targeted notifications for auto-created bounties#3280
fix: enable targeted notifications for auto-created bounties#3280jeevan6996 wants to merge 2 commits intoResearchHub:mainfrom
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 12240d0. Configure here.
|
|
Implemented the requested behavior change and pushed updates. Notifications are now sent only when target_hub_ids are provided (if target_hubs guard), and I added a regression test to assert no BOUNTY_FOR_YOU notification is created when target_hub_ids is omitted. |




Summary
Wires targeted bounty notifications into the
/api/bounty/create path so bounties created through the generic bounty endpoint can notify qualified users whentarget_hub_idsare provided.Closes ResearchHub/issues#260
What changed
BountyViewSet.createnow acceptstarget_hub_idsfrom request datafind_qualified_users_and_notifytask/pipeline after bounty creationcreate_comment_with_bountyFiles
src/reputation/views/bounty_view.pysrc/reputation/tests/test_bounties.pyChecks run
python3 -m py_compile reputation/views/bounty_view.py reputation/tests/test_bounties.pyChecks attempted but blocked by environment
python3 manage.py test reputation.tests.test_bounties.BountyViewTests.test_user_can_create_bounty_with_targeted_notifications --keepdbModuleNotFoundError: No module named 'django')Note
Medium Risk
Changes the bounty creation request handling and introduces conditional synchronous/asynchronous notification dispatch, which could affect API behavior and notification volume if misconfigured.
Overview
POST /api/bounty/now acceptstarget_hub_idsand, after creating the bounty, triggers the existingfind_qualified_users_and_notifypipeline to sendBOUNTY_FOR_YOUnotifications to qualified users (excluding the creator). InTESTINGit runs inline; otherwise it dispatches the Celery task asynchronously.Adds test coverage to verify notifications are created when
target_hub_idsare provided and that no targeted notifications are sent when they’re omitted.Reviewed by Cursor Bugbot for commit f6deed8. Bugbot is set up for automated code reviews on this repo. Configure here.