How does Discourse handle the Read/Unread for users?

Hey guys!

I’m currently learning coding and I’m wondering what is the schema or technique for read / unread posts in Discourse?

I’ve seen how SMF does it, through a combination of Mark Board Read, Mark All Read, and marked read when seen the last post… etc.

How does Discourse handle this?

Thanks! =)

1 Like

It’s best to delve into the Source:

Topic read state (by user) is tracked by the TopicUser model?:

(the data of which is stored in the Postgres DB).

You can interact with this on the rails console, from the discourse directory in dev, go rails c
then you can do something like TopicUser.first and look at the data …

1 Like

Sweet. I see the schema right down there thanks!

1 Like