Skip to content

Commit 8775307

Browse files
committed
Add message thread update code
1 parent 153f044 commit 8775307

3 files changed

Lines changed: 23 additions & 8 deletions

File tree

api/pkg/listeners/message_thread_listener.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (listener *MessageThreadListener) OnMessageAPISent(ctx context.Context, eve
5959
Owner: payload.Owner,
6060
Contact: payload.Contact,
6161
UserID: payload.UserID,
62-
Status: entities.MessageStatusSent,
62+
Status: entities.MessageStatusPending,
6363
Timestamp: payload.RequestReceivedAt,
6464
Content: payload.Content,
6565
MessageID: payload.MessageID,

api/pkg/services/message_thread_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (service *MessageThreadService) UpdateThread(ctx context.Context, params Me
6262
return service.tracer.WrapErrorSpan(span, stacktrace.Propagate(err, msg))
6363
}
6464

65-
if thread.OrderTimestamp.Unix() > params.Timestamp.Unix() {
65+
if thread.OrderTimestamp.Unix() > params.Timestamp.Unix() && thread.Status != entities.MessageStatusFailed {
6666
ctxLogger.Info(fmt.Sprintf("thread [%s] has timestamp [%s] which is greater than timestamp [%s] for message [%s]", thread.ID, thread.OrderTimestamp, params.Timestamp, params.MessageID))
6767
return nil
6868
}

web/components/MessageThread.vue

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,34 @@
8989
<v-list-item-action-text>
9090
{{ threadDate(thread.order_timestamp) }}
9191
</v-list-item-action-text>
92-
<v-icon v-if="thread.status === 'expired'" color="warning">{{
93-
mdiAlert
94-
}}</v-icon>
95-
<v-icon v-else-if="thread.status === 'delivered'" color="primary">
92+
<v-icon
93+
v-if="thread.status === 'expired'"
94+
color="warning"
95+
small
96+
>{{ mdiAlert }}</v-icon
97+
>
98+
<v-icon
99+
v-else-if="thread.status === 'delivered'"
100+
color="primary"
101+
small
102+
>
96103
{{ mdiCheckAll }}
97104
</v-icon>
98-
<v-icon v-else-if="thread.status === 'received'" color="success">
105+
<v-icon
106+
v-else-if="thread.status === 'received'"
107+
color="success"
108+
small
109+
>
99110
{{ mdiCheckAll }}
100111
</v-icon>
101112
<v-icon v-else-if="thread.status === 'sent'">
102113
{{ mdiCheck }}
103114
</v-icon>
104-
<v-icon v-else-if="thread.status === 'failed'" color="error">
115+
<v-icon
116+
v-else-if="thread.status === 'failed'"
117+
color="error"
118+
small
119+
>
105120
{{ mdiAlert }}
106121
</v-icon>
107122
</v-list-item-action>

0 commit comments

Comments
 (0)