Class: Events::BounceBack
Overview
Transient failure event emitted when LLM delivery fails inside the Bounce Back transaction. The user event record is rolled back, and this event notifies clients to remove the phantom message and restore the text to the input field.
Not persisted — not included in Message::TYPES.
Constant Summary collapse
- TYPE =
"bounce_back"
Instance Attribute Summary collapse
-
#error ⇒ String
readonly
Human-readable error description.
-
#message_id ⇒ Integer?
readonly
Database ID of the rolled-back message (for client-side removal).
Attributes inherited from Base
#content, #session_id, #timestamp
Instance Method Summary collapse
-
#initialize(content:, error:, session_id:, message_id: nil) ⇒ BounceBack
constructor
A new instance of BounceBack.
- #to_h ⇒ Object
- #type ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(content:, error:, session_id:, message_id: nil) ⇒ BounceBack
Returns a new instance of BounceBack.
23 24 25 26 27 |
# File 'lib/events/bounce_back.rb', line 23 def initialize(content:, error:, session_id:, message_id: nil) super(content: content, session_id: session_id) @error = error @message_id = end |
Instance Attribute Details
#error ⇒ String (readonly)
Returns human-readable error description.
14 15 16 |
# File 'lib/events/bounce_back.rb', line 14 def error @error end |
#message_id ⇒ Integer? (readonly)
Returns database ID of the rolled-back message (for client-side removal).
17 18 19 |
# File 'lib/events/bounce_back.rb', line 17 def @message_id end |
Instance Method Details
#to_h ⇒ Object
33 34 35 |
# File 'lib/events/bounce_back.rb', line 33 def to_h super.merge(error: error, message_id: ) end |
#type ⇒ Object
29 30 31 |
# File 'lib/events/bounce_back.rb', line 29 def type TYPE end |