in the after_commit method of hypermodel, the SendPacket operation is run which will return a promise, but it is not checked for an error state.
defself.after_commit(operation,model)# Calling public_columns_hash once insures all policies are loaded# before the first broadcast.@public_columns_hash ||= ActiveRecord::Base.public_columns_hashHyperstack::InternalPolicy.regulate_broadcast(model)do |data|
puts"Broadcast aftercommit hook: #{data}"ifHyperstack::Connection.show_diagnosticsif !Hyperstack.on_server? && Hyperstack::Connection.root_pathsend_to_server(operation,data,model.__synchromesh_update_time)rescuenil# fails if server no longer running so ignoreelseSendPacket.run(data,operation: operation,updated_at: model.__synchromesh_update_time)endendrescueActiveRecord::StatementInvalid=>eraiseeunlesse.message == "Could not find table 'hyperstack_connections'"endunlessRUBY_ENGINE == 'opal'The line containing SendPacket should be
SendPacket.run(data,operation: operation,updated_at: model.__synchromesh_update_time).tap{ |p| raisep.errorifp.error}The easiest way to patch this is by adding this:
moduleHyperstackclassInternalPolicyaliasoriginal_send_messagesend_messagedefsend_message(*args, &block)original_send_message(*args, &block).tap{ |p| raisep.errorifp.is_a?(Promise) && p.error}endendendThis will catch the error with the smallest patch. Note the patch needs to check if its a promise, but the actual fix does not.
in the after_commit method of hypermodel, the
SendPacketoperation is run which will return a promise, but it is not checked for an error state.The line containing
SendPacketshould beThe easiest way to patch this is by adding this:
This will catch the error with the smallest patch. Note the patch needs to check if its a promise, but the actual fix does not.