thecore_backend_commons 3.13.0 → 3.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 465d99db5c28a0099476fa5f4b862390f661dae07a0a54ac3c2c6b21597cbcfa
|
|
4
|
+
data.tar.gz: b4282d66700aafe387cbb3382a531950c80787034b924cb56c12f97e2a222ccc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4b3948959b20e0e131e489596e6399952936ae84440b522df5fc41fc0f4f9d6fac4ef9ab01e8f7bb9c74fb8ddc8021d8587df41f29d314f375be59d9cd14358
|
|
7
|
+
data.tar.gz: f97bfd47f4de73499ce7f48bd9b6837d56d9b19b9ba13a3a1c68c1a66a9482d94b4496aa2f318fc42762e857b08fb54881a6e6e1a4b26cbb76959df6eb6b9730
|
|
@@ -59,10 +59,19 @@ module ThecoreBackendCommons
|
|
|
59
59
|
}
|
|
60
60
|
end
|
|
61
61
|
|
|
62
|
+
# Sends the message when broadcasting is on. A failure to send (adapter missing, Redis down, …)
|
|
63
|
+
# is logged and reported to Rails.error, never raised: the change it announces is already done,
|
|
64
|
+
# and raising here would turn a committed save or destroy into an error (GitHub #6).
|
|
62
65
|
def broadcast(record, **outcome)
|
|
63
66
|
return unless enabled?
|
|
64
67
|
|
|
65
68
|
ActionCable.server.broadcast(ROOM, message(record, **outcome))
|
|
69
|
+
rescue StandardError => e
|
|
70
|
+
context = { model: record.class.name, id: record.id }
|
|
71
|
+
Rails.logger.error(
|
|
72
|
+
"[ActivityLog] record-change message not sent for #{context[:model]}##{context[:id].inspect}: #{e.class}: #{e.message}"
|
|
73
|
+
)
|
|
74
|
+
Rails.error.report(e, handled: true, context: context)
|
|
66
75
|
end
|
|
67
76
|
|
|
68
77
|
private
|