dosubot[bot] commented on issue #8525:
URL: 
https://github.com/apache/incubator-devlake/issues/8525#issuecomment-3153956168

   <!-- Answer -->
   You're correct about the root cause: the notification for pipeline status 
changes is sent asynchronously right after updating the pipeline status in the 
database, but before the transaction is guaranteed to be fully committed. This 
can lead to race conditions where notifications are sent for uncommitted or 
intermediate states, causing duplicates or missing notifications, as you've 
observed. There are currently no safeguards in the code to ensure notifications 
are only sent after the transaction is committed, nor is there deduplication 
logic to prevent multiple notifications for the same status 
[reference](https://github.com/apache/incubator-devlake/blob/2c15ad880dce830c6512fa58039527cbf4745b8b/backend/server/services/pipeline.go).
   
   No recent PRs address this, and while there are related feature requests and 
discussions about notification improvements, this specific bug hasn't been 
reported before [feature request 
context](https://github.com/apache/incubator-devlake/issues/8408).
   
   To resolve this, you’ll want to ensure that notifications are only sent 
after the transaction is fully committed—possibly by moving notification logic 
outside the transaction or by using a post-commit hook if your transaction 
helper supports it. Adding deduplication logic to prevent repeated 
notifications for the same status would also help. Let me know if you want to 
discuss implementation details or need help navigating the relevant parts of 
the code.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/74b6200e-54e4-4bec-ba44-92614d48d8dc?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/74b6200e-54e4-4bec-ba44-92614d48d8dc?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/74b6200e-54e4-4bec-ba44-92614d48d8dc?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/74b6200e-54e4-4bec-ba44-92614d48d8dc?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/74b6200e-54e4-4bec-ba44-92614d48d8dc?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/74b6200e-54e4-4bec-ba44-92614d48d8dc?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/74b6200e-54e4-4bec-ba44-92614d48d8dc?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/b4e8e847-d479-4541-83a8-d88d83fea5c9/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/incubator-devlake/issues/8525)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@devlake.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to