REST API 요청 시 토픽 조회 수가 업데이트되지 않습니다

In last Version 3.4.0.beta4-dev I noted that topic views doesn’t update when using rest API requests. Even putting headers likeDiscourse-Visible, X-Requested-With or even more

‘Discourse-Visible’: ‘true’,
‘Discourse-Logged-In’ : ‘true’,
‘Discourse-Present’: ‘true’,
‘Discourse-Track-View’: ‘true’,
‘Discourse-Track-View-Topic-Id’: 2214

I don’t know if this is a bug or is something that is programmed like that. But in previous version this behaviour didn’t happen

I would be very grateful if you could help me with this issue.

Thank you very much

Is this something that just happening to me ?

I would really appreciate any help you can give me with this problem. I’ve tried several things without success. I think I’ve set all the possible headers I’ve seen in the reverse engineering I’ve done, and the views still aren’t updating. I think there must be a header I’m missing.

By the way I’m using admin API keys instead of User api keys. I hope this is not a problem

Thank you very much

API requests don’t track views, unconditionally, by design.

I guess you are after some feature request here to allow you to track views via our API, recategorizing.

2개의 좋아요

hmmm :thinking:
Thank you @sam but I wonder why before 3.4.0.beta-4 version it did it ?

also if User::last_seen_at is updated why not the views ?

When you say a feature it means a plugin that allow me to track views via API ?

Thank you again

@david can you clarify here, is there a change missing from request tracker?

Topic views have been migrated to use our “browser pageviews” system. That means that they no longer include any kind of API or crawler requests.

The DISCOURSE_VISIBLE header relates only to the legacy pageviews system.

3개의 좋아요

API 트래픽(모바일 앱, 통합 등)을 토픽 조회수로 집계하고 싶으시다면, 이를 정확히 수행하는 작은 플러그인을 공개했습니다:

:link: api-topic-views
https://github.com/gorfist/api-topic-views

이 플러그인은 TopicsController#show에 연결되어 자격이 있는 API/사용자 API 요청을 토픽 조회수로 집계하며, 커스텀 헤더, 레이트 리미팅, 크롤러 필터링, 사용자 인식 추적 등의 옵션을 제공합니다.

아직 출시된 지 얼마 되지 않아 완전히 검증되지는 않았지만, 대부분의 자체 호스팅 환경에서 잘 작동할 것입니다. 피드백이나 PR을 환영합니다!

1개의 좋아요

와, 정말 감사합니다 :+1: @Nima1
직접 테스트해 보고 피드백을 드리겠습니다.

1개의 좋아요