Skip to content

Home / Guides / Website care

Website care

Reproduce a bug as the account that has it

A saved filter silently emptied one member's feed and five server tests passed, because they ran as the wrong account. What to check first, and the design fix.

By Shane Rounce · 2 min read

I needed to reproduce a bug on a news site I build and run for a client: one of the topic feeds was reported broken. Signed in, it showed the same handful of weeks-old stories every time. As a guest, it was fine.

I tested the server five different ways. Every test passed. The feed query was correct, the cache was correct, the ranking was correct. It took hours to find the problem, and the problem was not in the code at all. It was in which account I was testing as.

A filter nobody could see

The site lets members save a preference for which kinds of outlet they want to see. If a request does not carry an explicit filter, the saved preference is applied as the default. That is a reasonable feature.

The account that had the problem had saved a narrow preference at some point and forgotten about it. Nothing on the page showed that a filter was active. It silently cut that member's feed by about 70%, and in that particular topic only a dozen matching stories existed. So the same few old cards came back every time.

Clearing the saved preference fixed it immediately, and the feed came back full and current.

Why five tests missed it

Every test I ran was as my own administrator account, which had no saved preferences. The bug only existed for the account that had one. I was carefully proving that the site worked for someone who did not have the problem.

That is the lesson, and it applies far beyond this site:

When a symptom is "fine as a guest, broken signed in", reproduce it as that exact account. Look at that account's saved settings and stored data before you look at the code.

Reproduce a bug: what to check first

  • The account's own data. Saved preferences, user meta, roles, membership levels, a basket, a draft. In WordPress, list the user's meta before anything else.
  • Anything applied by default. Saved filters, remembered locations, a preferred currency or language. Defaults are invisible by design.
  • Per-account caches. A personalised fragment cached for one user can outlive the change that should have refreshed it.
  • Browser storage. Settings kept in the browser follow the device, not the account, so a second browser can look like a second user.

The design fix

Finding it was the first half. The second half is making sure no one else loses hours to it. If a saved preference is changing what someone sees, the page should say so, with a way to clear it in one tap. A filter you cannot see is not a feature. It is a bug report waiting to happen.

I now ask this of every personalised feature I build: if this setting is on, can the person tell from the page? If not, it needs a visible label before it ships.

Need a hand with your next project?

I help with website care, with practical advice and hands-on work. Tell me what you are trying to improve.

Email Shane