Skip to content

Commit d1098c2

Browse files
AchoArnoldCopilot
andcommitted
feat: use millisecond precision for bulk message request IDs and show filename in UI
- Change generateRequestID to use time.Now().UnixMilli() for millisecond precision timestamps - Rename table column header from 'ID' to 'Name' - Update cleanName to extract filename from new bulk-{timestamp}-{name} format - Maintain backward compatibility for old bulk-csv-* and bulk-xls-* formats Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9a8a681 commit d1098c2

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

api/pkg/handlers/bulk_message_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (h *BulkMessageHandler) Store(c *fiber.Ctx) error {
147147
}
148148

149149
func (h *BulkMessageHandler) generateRequestID(filename string) string {
150-
return fmt.Sprintf("bulk-%s-%s", encodeBase62(time.Now().Unix()), truncateFilename(sanitizeFilename(filename), 32))
150+
return fmt.Sprintf("bulk-%s-%s", encodeBase62(time.Now().UnixMilli()), truncateFilename(sanitizeFilename(filename), 32))
151151
}
152152

153153
func sanitizeFilename(filename string) string {

web/pages/bulk-messages/index.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
<template #default>
114114
<thead>
115115
<tr class="text-uppercase subtitle-2">
116-
<th class="text-left">ID</th>
116+
<th class="text-left">Name</th>
117117
<th class="text-center">Created At</th>
118118
<th class="text-center">Total</th>
119119
<th class="text-center">Pending</th>
@@ -227,6 +227,11 @@ export default Vue.extend({
227227
if (requestId.startsWith('bulk-xls-')) {
228228
return requestId.replace(/^bulk-xls-/, '') + '.xlsx'
229229
}
230+
// New format: bulk-{base62_timestamp}-{filename}
231+
const newFormatMatch = requestId.match(/^bulk-[0-9A-Za-z]+-(.+)$/)
232+
if (newFormatMatch) {
233+
return newFormatMatch[1]
234+
}
230235
return requestId.replace(/^bulk-/, '')
231236
},
232237
fetchBulkOrders() {

0 commit comments

Comments
 (0)