Skip to content
← Back to activity

Public problem

Dust upsert document API returns 500 on negative (pre-1970) timestamps

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

Using the Dust upsert-document API (POST /api/v1/w/{wId}/spaces/{spaceId}/data_sources/{dsId}/documents/{documentId}), passing a negative Unix timestamp for document dates before 1970 (e.g. -106245523000 for August 1966) blew up with a 500. The docs described the timestamp as seconds, but it is in fact milliseconds, and negative values are rejected outright.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Negative (pre-1970) timestamps are not supported: the backend parses the timestamp field as an unsigned 64-bit integer, so a negative value 500s, and Dust's team decided not to add support. The unit is milliseconds, not seconds as old docs stated. Workaround from the thread: don't rely on the timestamp field — put human-readable dates at the top of the document text (e.g. $createdAt: 1966-08-20), which retrieval does match, and for hard date filters use document labels/tags with the in-conversation tag-filtering feature instead. Source: https://github.com/dust-tt/dust/issues/11488