Post date oddities, search


(Andrew Waugh) #1

Has something changed recently which affects post dates on historical posts?

I ran into this today:

I searched: Search results for 'adjust after:2018-07-13 order:latest' - Jag-lovers Forums

First hit is: [E-Type] Bonnet Restoration - E-Type - Jag-lovers Forums

If you look at that topic, you will see that it was started Dec 15, 1998.

The last reply shows up as 1 minute ago, and 100 years between the 2nd last post, and the reply.

BUT:

100 years haven’t passed since 1998 (although it sometimes feels that way).
That 1 min has been almost 2 hours long.
If the final post had a malformed (y2k incompatible) datestamp, then presumably so would all the posts in that topic.
If the post’s datestamp really is that new, then shouldn’t it appear in “latest”? (It doesn’t.)

Seaching for “future” posts gives 37 hits at the moment: Search results for ‘after:2018-07-16’ - Jag-lovers Forums (That might explain why they don’t show up in “latest” or “new”.

If we had a y2k issue then I would expect we’d have seen it long before now, and there’d be a lot more than 37 posts in the future.

What gives?


(Mittineague) #2

Not likely for Switzerland, but sny chance it might have something to do with this - (2018-05-10)

https://www.postgresql.org/docs/9.5/static/release-9-5-13.html

  • Update time zone data files to tzdata release 2018d for DST law changes in Palestine and Antarctica (Casey Station), plus historical corrections for Portugal and its colonies, as well as Enderbury, Jamaica, Turks & Caicos Islands, and Uruguay.

(Andrew Waugh) #3

Could be, but then I expect someone else would have noticed it too.

EDIT: Doesn’t seem to be specific to Switzerland, another mod is seeing the same thing in Norway.


(Sam Saffron) #4

Possibly related to some changes @tgxworld was making, can you confirm you are on latest?


(Andrew Waugh) #6

We’re currently at 9a81321.


(Alan Tan) #7

@JagWaugh Can you provide me with the output of the following commands?

./launcher enter app
cd /var/www/discourse
bundle exec rails c
topic = Topic.find(47939)
topic_view = TopicView.new(topic)
puts topic_view.filtered_post_stream
puts TimelineLookup.build(topic_view.filtered_post_stream)

(Andrew Waugh) #8

I haven’t got ssh access, but I’ve messaged @Gunnar.

We’re still a bit behind latest. Would you like that output before updating, after updating, or both?


(Sam Saffron) #9

Please update to latest first and then confirm it is still an issue and then run the commands.


(Gunnar Helliesen) #10

Here you go: Output for tgxworld - Pastebin.com

Thanks,
Gunnar


(Alan Tan) #11

Can you run one more command thank you!

Topic.find(47939).posts.pluck(:create_at)

(Gunnar Helliesen) #13

For Alan @tgxworld, more output:

root@dewis:/var/discourse# ./launcher enter app
root@dewis-app:/var/www/discourse# su discourse
discourse@dewis-app:/var/www/discourse$ bundle exec rails c
Loading production environment (Rails 5.2.0)
irb(main):001:0> Topic.find(47939).posts.pluck(:create_at)
Traceback (most recent call last):
        3: from (irb):1
        2: from lib/freedom_patches/fast_pluck.rb:59:in `pluck'
        1: from lib/freedom_patches/fast_pluck.rb:39:in `select_raw'
ActiveRecord::StatementInvalid (PG::UndefinedColumn: ERROR:  column "create_at" does not exist)
LINE 1: SELECT "create_at" FROM "posts" WHERE ("posts"."deleted_at" ...
               ^
HINT:  Perhaps you meant to reference the column "posts.created_at".
: SELECT "create_at" FROM "posts" WHERE ("posts"."deleted_at" IS NULL) AND "posts"."topic_id" = 47939
irb(main):002:0>

Before and after are not implemented right in search
(Alan Tan) #14

The command should be Topic.find(47939).posts.pluck(:created_at)


(Gunnar Helliesen) #15
irb(main):001:0> Topic.find(47939).posts.pluck(:created_at)

=> [1998-12-15 11:26:00 UTC, 1998-12-15 14:34:01 UTC, 1998-12-17 09:58:11 UTC, 1998-12-17 10:07:14 UTC, 1998-12-18 02:20:22 UTC, 2098-12-15 02:14:39 UTC]

irb(main):002:0>

(Alan Tan) #16

Hmm was the data in the forum imported? The last time-stamp looks very odd to me.


(Gunnar Helliesen) #17

Yes, they were. From mailbox files going all the way back to 1994. Back then dates in email headers could turn up in all sorts of interesting formats.


(Alan Tan) #18

This is likely an import problem. The timestamp for the last post returns a date in the future "created_at": "2098-12-15T02:14:39.000Z". My suggestion will be to fix posts with incorrect timestamps manually via the rails console.