مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
style(rubocop): Style/SafeNavigation
هذا الالتزام موجود في:
@@ -84,11 +84,6 @@ Style/ConditionalAssignment:
|
||||
Style/EmptyMethod:
|
||||
EnforcedStyle: expanded
|
||||
|
||||
# We do not wish to auto correct unused method arguments because that can be a
|
||||
# pain. These should just be flagged for manual intervention.
|
||||
Lint/UnusedMethodArgument:
|
||||
AutoCorrect: false
|
||||
|
||||
# As above, just flag them.
|
||||
Lint/UnusedBlockArgument:
|
||||
AutoCorrect: false
|
||||
@@ -179,3 +174,6 @@ Metrics/BlockLength:
|
||||
|
||||
Metrics/ClassLength:
|
||||
Enabled: false
|
||||
|
||||
Lint/UnusedMethodArgument:
|
||||
Enabled: false
|
||||
|
||||
@@ -7,9 +7,9 @@ structure :message do
|
||||
expansion(:status) do
|
||||
{
|
||||
status: o.status,
|
||||
last_delivery_attempt: o.last_delivery_attempt ? o.last_delivery_attempt.to_f : nil,
|
||||
last_delivery_attempt: o.last_delivery_attempt&.to_f,
|
||||
held: o.held,
|
||||
hold_expiry: o.hold_expiry ? o.hold_expiry.to_f : nil
|
||||
hold_expiry: o.hold_expiry&.to_f
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -5,8 +5,7 @@ class SendWebhookJob < Postal::Job
|
||||
def perform
|
||||
if server = Server.find(params["server_id"])
|
||||
new_items = {}
|
||||
if params["payload"]
|
||||
params["payload"].each do |key, value|
|
||||
params["payload"]&.each do |key, value|
|
||||
next unless key.to_s =~ /\A_(\w+)/
|
||||
|
||||
begin
|
||||
@@ -14,7 +13,6 @@ class SendWebhookJob < Postal::Job
|
||||
rescue Postal::MessageDB::Message::NotFound
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
new_items.each do |key, value|
|
||||
params["payload"].delete("_#{key}")
|
||||
|
||||
@@ -430,15 +430,13 @@ class UnqueueMessageJob < Postal::Job
|
||||
if defined?(Sentry)
|
||||
Sentry.capture_exception(e, extra: { job_id: self.id, server_id: queued_message.server_id, message_id: queued_message.message_id })
|
||||
end
|
||||
if queued_message.message
|
||||
queued_message.message.create_delivery("Error",
|
||||
queued_message.message&.create_delivery("Error",
|
||||
details: "An internal error occurred while sending " \
|
||||
"this message. This message will be retried " \
|
||||
"automatically.",
|
||||
output: "#{e.class}: #{e.message}", log_id: "J-#{self.id}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
else
|
||||
log "Couldn't get lock for message #{params['id']}. I won't do this."
|
||||
|
||||
@@ -335,7 +335,7 @@ module Postal
|
||||
# Return the recipient domain for this message
|
||||
#
|
||||
def recipient_domain
|
||||
rcpt_to ? rcpt_to.split("@").last : nil
|
||||
rcpt_to&.split("@")&.last
|
||||
end
|
||||
|
||||
#
|
||||
|
||||
@@ -380,7 +380,7 @@ module Postal
|
||||
else
|
||||
idata = idata.to_s.sub(/\A\.\./, ".")
|
||||
|
||||
if @credential && @credential.server.log_smtp_data?
|
||||
if @credential&.server&.log_smtp_data?
|
||||
# We want to log if enabled
|
||||
else
|
||||
log "Not logging further message data."
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم