diff --git a/clients/destination/v0/destination.go b/clients/destination/v0/destination.go index 53e9488a4f..6e5dac2e93 100644 --- a/clients/destination/v0/destination.go +++ b/clients/destination/v0/destination.go @@ -260,6 +260,7 @@ func (c *Client) Write(ctx context.Context, source string, syncTime time.Time, r if err != nil { return 0, fmt.Errorf("failed to call Write: %w", err) } + syncTime = syncTime.Truncate(time.Microsecond) for resource := range resources { if err := saveClient.Send(&pb.Write_Request{ Resource: resource, @@ -297,7 +298,7 @@ func (c *Client) Write2(ctx context.Context, sourceSpec specs.Source, tables sch if err := saveClient.Send(&pb.Write2_Request{ Tables: b, Source: sourceSpec.Name, - Timestamp: timestamppb.New(syncTime), + Timestamp: timestamppb.New(syncTime.Truncate(time.Microsecond)), SourceSpec: sourceSpecBytes, }); err != nil { return fmt.Errorf("failed to send tables: %w", err) @@ -335,7 +336,7 @@ func (c *Client) DeleteStale(ctx context.Context, tables schema.Tables, source s } if _, err := c.pbClient.DeleteStale(ctx, &pb.DeleteStale_Request{ Source: source, - Timestamp: timestamppb.New(timestamp), + Timestamp: timestamppb.New(timestamp.Truncate(time.Microsecond)), Tables: b, }); err != nil { return fmt.Errorf("failed to call DeleteStale: %w", err)