diff --git a/tapiriik/web/templates/diag/dashboard.html b/tapiriik/web/templates/diag/dashboard.html
index 4ffeeb86b..a598304a7 100644
--- a/tapiriik/web/templates/diag/dashboard.html
+++ b/tapiriik/web/templates/diag/dashboard.html
@@ -79,6 +79,30 @@
Sync
{% endif %}
+ Queued but unlocked records:
+
+
+ Worker |
+ Host |
+ User |
+ ID |
+ Prog |
+ State |
+
+ {% for unlockedUser in queuedUnlockedUsers %}
+ {% with userId=unlockedUser|dict_get:'_id' %}
+
+ {{ unlockedUser.SynchronizationWorker }} |
+ {{ unlockedUser.SynchronizationHost }} |
+ {{ userId|slice:":7" }} |
+ {{ userId }} |
+ {{ unlockedUser.SynchronizationProgress|percentage }} |
+ {% if unlockedUser.SynchronizationWorker not in allWorkerPIDs and unlockedUser.SynchronizationWorker not in allWorkerPIDsPre %} (orphaned){% endif %}{% if unlockedUser.SynchronizationWorker in stalledWorkerPIDs %} (stalled){% endif %} |
+
+ {% endwith %}
+ {% endfor %}
+
+
diff --git a/tapiriik/web/views/diagnostics.py b/tapiriik/web/views/diagnostics.py
index a9b7d3a9c..b18ddf211 100644
--- a/tapiriik/web/views/diagnostics.py
+++ b/tapiriik/web/views/diagnostics.py
@@ -27,6 +27,7 @@ def diag_dashboard(req):
context["lockedSyncUsers"] = list(db.users.find({"SynchronizationWorker": {"$ne": None}}))
context["lockedSyncRecords"] = len(context["lockedSyncUsers"])
+ context["queuedUnlockedUsers"] = list(db.users.find({"SynchronizationWorker": {"$exists": False}, "QueuedAt": {"$ne": None}}))
context["pendingSynchronizations"] = db.users.find({"NextSynchronization": {"$lt": datetime.utcnow()}}).count()
context["pendingSynchronizationsLocked"] = db.users.find({"NextSynchronization": {"$lt": datetime.utcnow()}, "SynchronizationWorker": {"$ne": None}}).count()