[Bug] - Message datetime uses render time even when a saved timestamp is supplied
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- react, typescript
- Área
- frontend
Línea de trabajo
Start in packages/module/src/Message/Message.tsx, where a new Date() is created during render and passed to the nested Timestamp component. Check how the timestamp prop is used for display and whether a date value can be forwarded alongside it. Done means the time element's datetime attribute matches the supplied instant and stays stable across rerenders; the API shape is still open, so confirm it with maintainers before coding.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
When a saved timestamp is passed to Message, the visible timestamp and the message section's accessible label correctly use the supplied string. However, the underlying <time datetime="..."> attribute still contains the time of rendering. It also changes on subsequent renders.
This makes the machine-readable timestamp disagree with the displayed message time. Consumers can supply timestamp?: string, but cannot supply the actual date to the nested PatternFly Timestamp component.
The implementation creates const date = new Date() during rendering and uses <Timestamp date={date}>{timestamp}</Timestamp>:
https://github.com/patternfly/chatbot/blob/aca7848d3212003a20ebcd916217e9d29c9862e6/packages/module/src/Message/Message.tsx
Expected: Consumers should be able to provide the saved message instant so that both the displayed timestamp and the HTML datetime describe that instant and remain stable across rerenders.
Actual: Supplying timestamp fixes the displayed text, but datetime continues to describe render time.
Related reports #448 and #299, and documentation PR #302, explain that applications must supply persistent timestamps. This report concerns the remaining HTML datetime mismatch even after following that guidance.
A possible backward-compatible solution is an optional date prop forwarded to the native Timestamp, while retaining the existing display-string prop and default behavior. The API shape is open for discussion; localized display strings should not need to be parsed to recover the date.
Steps to Reproduce
- Render the example below using
@patternfly/chatbot. - Inspect the
<time>element inside the message in browser developer tools. - Notice that its text is the supplied historical timestamp, while its
datetimeattribute is the current render time rather than2025-01-15T10:00:00.000Z. - Wait a few seconds, then click Rerender.
- Inspect the same element again: the displayed text remains unchanged, but
datetimehas advanced.
Data/JSON Context (if applicable)
import { useState } from 'react';
import { Message } from '@patternfly/chatbot';
export default function TimestampReproduction() {
const [renderCount, setRenderCount] = useState(0);
return (
<>
<button onClick={() => setRenderCount((count) => count + 1)}>
Rerender ({renderCount})
</button>
<Message
role="user"
name="You"
content="A saved message"
timestamp="2025-01-15 10:00:00 UTC"
/>
</>
);
}
Environment
- PatternFly Chatbot:
6.7.1 - PatternFly React Core:
6.6.1 - React:
19.3.0 - Browser: Chromium (exact version not recorded)
- Viewport: observed in desktop chat; the date is generated in the component independently of layout
- The same timestamp implementation is present in the linked upstream source revision.
Screenshots or Logs
DOM inspection of a saved conversation showed the following values (displayed text was in Asia/Kolkata, UTC+05:30):
| Field | Value |
|---|---|
| Visible timestamp | 02/11/2026, 13:14:56 |
Expected datetime for that saved instant |
2026-11-02T07:44:56.000Z |
Actual datetime when the conversation was reopened |
2026-11-02T08:25:39.646Z |
The supplied visible timestamp remained correct; the HTML attribute represented the later render time.
- Lenguaje dominante
- TypeScript
- Estrellas
- 9
- Forks
- 39
- Merge medio
- 3 d 1 h
- PR fusionados (30 d)
- 15
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de patternfly/chatbot
-
PF Team
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
patternfly/chatbot#955 ·
Los mantenedores suelen responder en 1 día
-
HistoryDrawer - Docs look badAbiertoPF Team
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
patternfly/chatbot#852 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
patternfly/chatbot#918 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 42/100
patternfly/chatbot#915 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
patternfly/chatbot#905 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de patternfly/chatbot
Issues similares
-
[Site] Active section detection should respect scroll-margin-topPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea/web reproduced type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
anomalyco/opencode#65384 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
swc-project/swc-ai-issues#1001 ·
-
Add: Da Vinci Asia VietnamAbiertocheck:passed streams:add
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
fix(table): CollapseColumn uses wrong caret icon for expandable row togglePosiblemente ocupada @redhat-chai-bot la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
patternfly/patternfly-react#12727 ·
Los mantenedores suelen responder en 1 día
-
CLI OAuth login fails behind an authenticating proxy: GET /api/v1/user omits Proxy-AuthorizationAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
lightdash/lightdash#33086 · 1 comentario ·
Los mantenedores suelen responder en 1 día