Topic_link table contains wrong urls when using s3

Hi. I faced problem that external link clicks not counted for url that contains uploaded files hosted on s3 + cdn. Look this topic to understand the problem:

Open a “Racing” category, you will see something like this:

Test Drive never account a click on it. It’s because topic_link table does not contains record of it. All the links on this page use the same pattern:<encoded-url-to-file>

All links that works correctly are on files uploaded manually. But, links that not counted uploaded with discourse. E.g.: - COUNTING, - NOT COUNTING.

I dumped the topic_link table for this topic topic_link.csv (6.9 КБ)

If you look in it, all not counting links stored as<path-to-file> instead of correct<url-to-file>. Counting links are stored correctly.

I tried to find why this happens but no luck, topic_link.rb/extract_from do nothing with cdn :thinking:

1 Like

This seems like something we should clean up. Probably our CDN substitution happens after the extraction.

@vinothkannans can you investigate and see if you can repro here as well?


I’m unable to reproduce this issue yet. Anyway, it’s still in my list :memo:

Can I help you somehow?