Space watcher count on page creation


Problem: When a page is created and another user is watching the space viewtracker is registering the watching user as well as the creator.

How to reproduce:

  • Create a test space

  • Create a second user

  • Watch with the second user the test space

  • Create with the first user a page which contains the Viewtracker macro and the Table of contents macro

The output will be that there is only 1 view but in the table there will be 2 users


Confluence: 5.10.5


Jason Anderson
October 10, 2016, 7:19 PM

Thanks a bunch for the details and for delivering a fix so quickly. I'll look for this fix in a future update.

Sascha Häusler
October 7, 2016, 9:01 AM

Dear Mr. Anderson,

The fix won't remove invalid views because technically they are valid views which are saved in the database.
I would give you here 2 SQL queries which are for the MySQL database. If you don't have MySQL you need to adapt them for your specific database.

I cannot stress enough here that you before executing them you should backup your database so you can go back if you deleted too much.

The first query gives you all views with the page title, time difference between page creation and visit time, visit time and page creation. With this data you will hopefully be able to make a judgment if these views need to be deleted.
I also have to say that to find these views isn't an exact science since you have set a maximum difference in seconds which I set to 100 seconds since in my tests I had very different differences: 1, 59 and 95.
Search query:

Delete query:

If anything is not understandable or if you need help just ask freely.

Best regards,
Sascha Häusler

Jason Anderson
October 6, 2016, 4:21 PM

Any word on if this fix removes invalid views from existing pages?

Oliver Strässer
October 6, 2016, 2:46 PM

admin is a valid visit, all other users are invalid:

Jason Anderson
October 4, 2016, 6:58 PM

I'd also be interested in a way to remove incorrect view records that were added via this bug. I have tried to remove the Table of Contents after the problem occurs and it doesn't remove the incorrect views from the viewtracker table.

Your pinned fields
Click on the next to a field label to start pinning.


Oliver Strässer


Sascha Häusler