Chore: Fix Deserialisation Error in Jobs (#1683)
- Ignore Jobs on de-serialization error - Show empty conversations in chat UI Fixes: #1480
This commit is contained in:
@@ -35,6 +35,12 @@
|
||||
{{ this.$t(`${attachmentIconKey}.CONTENT`) }}
|
||||
</span>
|
||||
</p>
|
||||
<p v-else class="conversation--message">
|
||||
<i class="ion-android-alert"></i>
|
||||
<span>
|
||||
{{ this.$t(`CHAT_LIST.NO_MESSAGES`) }}
|
||||
</span>
|
||||
</p>
|
||||
<div class="conversation--meta">
|
||||
<span class="timestamp">
|
||||
{{ dynamicTime(chat.timestamp) }}
|
||||
|
||||
@@ -79,6 +79,7 @@
|
||||
},
|
||||
"RECEIVED_VIA_EMAIL": "Received via email",
|
||||
"VIEW_TWEET_IN_TWITTER": "View tweet in Twitter",
|
||||
"REPLY_TO_TWEET": "Reply to this tweet"
|
||||
"REPLY_TO_TWEET": "Reply to this tweet",
|
||||
"NO_MESSAGES": "No Messages"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
class ApplicationJob < ActiveJob::Base
|
||||
# https://api.rubyonrails.org/v5.2.1/classes/ActiveJob/Exceptions/ClassMethods.html
|
||||
discard_on ActiveJob::DeserializationError do |_job, error|
|
||||
Rails.logger.error("Skipping job because of ActiveJob::DeserializationError (#{error.message})")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,7 +11,9 @@ json.meta do
|
||||
end
|
||||
|
||||
json.id conversation.display_id
|
||||
if conversation.unread_incoming_messages.count.zero?
|
||||
if conversation.messages.count.zero?
|
||||
json.messages []
|
||||
elsif conversation.unread_incoming_messages.count.zero?
|
||||
json.messages [conversation.messages.includes([{ attachments: [{ file_attachment: [:blob] }] }]).last.try(:push_event_data)]
|
||||
else
|
||||
json.messages conversation.unread_messages.includes([:user, { attachments: [{ file_attachment: [:blob] }] }]).last(10).map(&:push_event_data)
|
||||
|
||||
Reference in New Issue
Block a user