UI: Messages show incorrect timestamps — 'Jan 21, 1970' for all conversations #53

Closed
opened 2026-04-15 12:51:57 +00:00 by zaelgohary · 2 comments
Member

Description

All conversations in the Messages chat list display timestamps of "Jan 21, 1970" — which is clearly a Unix epoch-related bug. The dates should show actual message timestamps.

Visible in screenshots:

  • "Engineering — Jan 21, 1970"
  • "Team General — Jan 21, 1970"

Steps to Reproduce

  1. Open Communication > Messages
  2. Look at conversation list timestamps
  3. All show "Jan 21, 1970"

Expected

Relative timestamps ("2m ago", "5h ago") or actual dates for older messages.

Root Cause

Likely a timestamp unit mismatch — the stored timestamps may be in seconds while the formatter expects milliseconds (or vice versa). Unix timestamp 0 = Jan 1 1970, and a small integer timestamp like 1814400 would equal Jan 21 1970.

Severity

Medium — incorrect but doesn't block functionality

## Description All conversations in the Messages chat list display timestamps of "Jan 21, 1970" — which is clearly a Unix epoch-related bug. The dates should show actual message timestamps. Visible in screenshots: - "Engineering — Jan 21, 1970" - "Team General — Jan 21, 1970" ## Steps to Reproduce 1. Open Communication > Messages 2. Look at conversation list timestamps 3. All show "Jan 21, 1970" ## Expected Relative timestamps ("2m ago", "5h ago") or actual dates for older messages. ## Root Cause Likely a timestamp unit mismatch — the stored timestamps may be in seconds while the formatter expects milliseconds (or vice versa). Unix timestamp 0 = Jan 1 1970, and a small integer timestamp like 1814400 would equal Jan 21 1970. ## Severity Medium — incorrect but doesn't block functionality
Author
Member

Screenshots

deep_msg_01_initial.png

deep_msg_01_initial.png

## Screenshots ### deep_msg_01_initial.png ![deep_msg_01_initial.png](https://forge.ourworld.tf/attachments/72b4817a-24bf-48e8-bbce-16288fc4bc19)
Author
Member

Root Cause Found

File: hero_archipelagos/archipelagos/messaging/src/services/messaging_service.rs line 234:

last_message_time: if conv.last_activity > 0 {
    Some(conv.last_activity as u64)
} else {
    None
},

conv.last_activity is in seconds since epoch, but format_relative_time() in messaging/src/islands/mod.rs:41 calls platform::current_timestamp_ms() (milliseconds) and computes diff = now_ms - timestamp_seconds. This makes the diff ~54 years, which triggers format_date(timestamp) — formatting a seconds-value as milliseconds gives a date near epoch (Jan 21, 1970).

Fix: Some(conv.last_activity as u64 * 1000)

## Root Cause Found File: `hero_archipelagos/archipelagos/messaging/src/services/messaging_service.rs` line 234: ```rust last_message_time: if conv.last_activity > 0 { Some(conv.last_activity as u64) } else { None }, ``` `conv.last_activity` is in **seconds** since epoch, but `format_relative_time()` in `messaging/src/islands/mod.rs:41` calls `platform::current_timestamp_ms()` (milliseconds) and computes `diff = now_ms - timestamp_seconds`. This makes the diff ~54 years, which triggers `format_date(timestamp)` — formatting a seconds-value as milliseconds gives a date near epoch (Jan 21, 1970). **Fix:** `Some(conv.last_activity as u64 * 1000)`
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_os#53
No description provided.