This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PUT Thread with PostDate parameter behaving differently this week than it did last week

I'm on SaaS, version 9.2.0.3957, using the C# sdk.

I use the following code to update a thread's body and subject, attempting to update the date as well:

dynamic telligentResponse = null;
host.Impersonate(telligentUser, (h) =>
{
    telligentResponse = host.PutToDynamic(2, $"forums/{forumId}/threads/{threadId}.json", true, new RestPutOptions
    {
        PostParameters = new System.Collections.Specialized.NameValueCollection {
            {"Forumid", forumId.ToString() },
            {"ThreadId", threadId.ToString() },
            {"Subject", subject },
            {"Body", body },
            {"PostDate", DateTime.UtcNow.ToString("r")}
        }
    });
});
return telligentResponse;

When I called this code last week, it had the effect of updating the date parameter on the thread, but the latestPostDate parameter was unmodified. This works for us.

This week though, if I create a new thread and update it with this code, it is updating both date and latestPostDate, meaning it is no longer possible to retrieve when a thread was originally posted (without looking at stickyDate, since my understanding is this date has another purpose). content.createdDate is also updated.

Furthermore, if I update a thread that was created last week with this code, date is updated and latestPostDate is not - the same behavior I saw last week.

What is going on here? Why does the thread create date seem to affect how the PostDate parameter is affecting the Thread?

Here are two examples: Thread 1 was created last week, and subsequently updated. Now, the dates are:

Thread1 - "latestPostDate":"2017-03-09T13:37:19.793"

Thread2 - "latestPostDate":"2017-03-17T13:06:14"

I run the code to update both threads. Now the date fields are:

Thread1 (date and latestPostDate different - latestPostDate unchanged, date set to PostDate value passed to the endpoint) - 

: : : "date":"2017-03-17T23:20:20",
: : : "latestPostDate":"2017-03-09T13:37:19.793",

Thread2 (both dates the same - both fields set to the PostDate value passed to the endpoint) - 

: : : "date":"2017-03-17T23:20:22",
: : : "latestPostDate":"2017-03-17T23:20:22",

These are two threads on the same forum, created by the same user (the same user that is trying to update them), and the only obvious difference appears to be when the threads were created. Let me know if you need more information about the threads involved in this scenario.

How can I ensure that I can return both when the thread was created and when the thread was updated, as is the case in thread 1 above? I was using latestPostDate for when the thread was created and date for when it was updated - is that valid? Why isn't it working this week? Did anything change? Daylight saving time (grasping here)?

A few other notes - trying to keep dates UTC at all times, so user's profile set to UTC (Casablanca), and post date is sent as a GMT time. This does make the times come back with the correct GMT time, which is what our application needs (in case you were wondering why PostDate is set to DateTime.UtcNow.ToString("r") - this works to set the correct time in our case).

Parents
No Data
Reply
  • I think there is some misunderstanding over what these paramaters are for.  These are NOT Create vs Update timestamps.  The date field is the date at which the thread was created.  If not set this should default to the current time, otherwise -(If you are setting it to DateTime.Now/UtcNow then you should not be setting this field at all).  The LastPostDate is the date at which the most recent reply was made to the thread.

    As an example, as I'm writing this reply, the thread has 0 replies, and so Date == LastPostDate.  The moment I post this reply, then this thread's Date will remain unchanged, but LastPostDate will be updated to ~ 1:10 GMT 20th March 2017.  If you were to go ahead and edit your post, then Post and LastPostDate would remain unchanged from before your edit.

Children
No Data