Closed maheshsattala closed 1 month ago
The code changes refine the determination of the is_resend
variable in the execute
method of the MessageBroadcast
class. Instead of relying on a boolean conversion, it now checks for an exact string match with "True". This update enhances clarity in managing event resending logic, ensuring that is_resend
accurately reflects the intended state based on input values.
Files | Change Summary |
---|---|
kairon/events/definitions/...py |
Modified is_resend logic in MessageBroadcast.execute : now checks if kwargs value is exactly "True". |
tests/unit_test/events/...py |
Updated test cases to pass is_resend as a string ("True") instead of a boolean (True). Adjusted assertions accordingly. |
sequenceDiagram
participant User
participant MessageBroadcast
participant EventHandler
User->>MessageBroadcast: execute(event_id, kwargs)
MessageBroadcast->>MessageBroadcast: Determine is_resend
alt is_resend == "True"
MessageBroadcast->>EventHandler: Resend event
else
MessageBroadcast->>EventHandler: Process normally
end
🌟 In the code where rabbits hop,
A boolean change, we won't stop!
To check for "True", precise and bright,
Ensures our broadcasts take flight!
So here’s to clarity, cheers we say,
As code hops forward, hip-hip-hooray! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
added is_resend flag for every event.
Summary by CodeRabbit
is_resend
variable to ensure it accurately reflects whether an event should be resent based on the input value.This change enhances the reliability of event handling in the application, resulting in more consistent behavior when managing message broadcasts.