Does read-only mode prevent users from getting the devotee badge?

AI-generated summary

In a discussion about whether read-only mode affects eligibility for the Devotee badge, Canapin reports setting their forum to read-only for maintenance and later noticing users (including themselves) were recorded as having visited only 364 days — suspecting an error. Benjamin_D initially suggests it shouldn’t affect badge progress, citing that user visit tracking appears to remain active even in read-only mode. However, simon clarifies that since no data is written to the database during read-only mode, user visits are not recorded — thus potentially breaking the consecutive day count required for the badge. Simon provides a SQL query to identify which specific days users missed visits, confirming that the read-only day was indeed not counted. Canapin confirms the query’s accuracy and attempts to manually award the badge via console, but notes the Devotee badge cannot be granted multiple times — though they appreciate the workaround for future use. The thread concludes with practical guidance for self-hosted vs. hosted sites regarding manual badge granting.

Hi!

I had to set the read-only mode on my forum for a bit more than a day for maintenance purpose.

Does it reset the day count for the Devotee badge?

Hi!
:thinking: I’d say no, as I didn’t find any reason why it would, as long as the user still visit the read-only forum. "start" seems to be only user related

And I remember that the “last seen” column of the users tab was alive even in read-only mode, so my guess is you’re in the clear :sweat_smile:

The “year in review” stated that some of my users (including myself) have only visited 364 days this year, which I’m pretty sure is wrong…

Is there a quick way to see which day these users have missed?

To answer your first question, I would expect putting a site into read only mode to affect users ability to get the Devotee badge. When a site is in read only mode, no new data is written to the database, so details about the user’s visits will not be recorded when the site is in read only mode.

Give this query a try. It returns the days that a user has not visited the site between a given start and end date:

Days without visits for user

--[params]
-- date :start_date
-- date :end_date
-- string :username

WITH days AS (
SELECT date_trunc('day', day)::date AS day
FROM generate_series(:start_date::date, :end_date::date, '1 day') AS day
),
users_visits AS (
SELECT
visited_at
FROM user_visits uv
JOIN users u ON u.id = uv.user_id
WHERE u.username = :username
AND visited_at BETWEEN :start_date AND :end_date
),
visits_days AS (
SELECT
day,
visited_at
FROM days 
LEFT JOIN users_visits uv
ON uv.visited_at = day
ORDER BY day DESC
)

SELECT day AS days_without_visits
FROM visits_days WHERE visited_at IS NULL
ORDER BY day DESC

If you would like to award the badge to some users who do not technically qualify for it, have a look at Award a non-custom badge through the console. Note, that approach is only possible on self-hosted sites. For sites on our hosting, we can grant the badges listed in that topic for you.

Thank you very much for your exhaustive reply.

The query indeed showed that users didn’t visit the forum the day it was read-only.

I’ll grant the badge from the console, thank you for this additional info :slight_smile:


Couldn’t grant the badge as the Devotee badge can’t be granted multiple times. But good to know anyway!