Skip to content

feat(admin): MQTT re-sync and clear & re-sync on the database page - #321

Merged
stakach merged 2 commits into
developfrom
feat/database-mqtt-resync
Oct 15, 2026
Merged

stakach merged 2 commits into
developfrom
feat/database-mqtt-resync

Conversation

@stakach

@stakach stakach commented Oct 15, 2026

Copy link
Copy Markdown
Member

Adds an MQTT card to Manage Instance → Database with two buttons:

  • Re-sync MQTT publishes every module's state and every model's metadata to the brokers again. No confirmation, since it's harmless.
  • Clear & Re-sync MQTT removes everything PlaceOS has published from the brokers first, for when what they hold has drifted. It asks first, since dashboards and alerts show nothing until the republish finishes. Dismissing the confirmation does nothing.

While a run is in progress, whether this user started it or someone else did, both buttons are disabled. The page shows its progress (polled every 2s) and reports when it finishes or fails. A 409 is reported as "already running". If the status can't be read (no permission, or an older PlaceOS), the status line is hidden.

It calls POST/GET /api/engine/v2/source/resync (PlaceOS/rest-api#454, system admin only), which uses source's clear-and-resync (PlaceOS/source#67). At 3,000 systems a clear and re-sync took 37s.

Draft until ts-client 6.11.0 is published

This needs sourceResync/sourceResyncStatus from PlaceOS/ts-client#33, which isn't released yet. That will be 6.11.0, since 6.10.0 is the reindex/backfill removal. Once it's published, @placeos/ts-client gets bumped here.

Testing

  • New database-details.component.spec.ts (6 tests, real template):
    • a re-sync starts without asking and is followed to completion;
    • clearing asks first, and a dismissal does nothing;
    • a confirmed clear passes clear=true and reports a failure;
    • a 409 warns;
    • a run already in progress when the page opens is followed;
    • an unreadable status is hidden.
  • Full unit suite: 1,028 pass. eslint is clean, and nx build backoffice passes. These ran against a local build of ts-client#33.
  • Not tried in a browser against a backend: the local stack's rest-api image doesn't include #454 yet, and building rest-api locally runs out of memory.
  • User stories AC-ADM-004-7 to 9 added.

🤖 Generated with Claude Code

Two buttons on Manage Instance > Database: re-sync publishes every
module's state and every model's metadata to the MQTT brokers again, and
clear & re-sync removes everything PlaceOS published first, after a
confirmation. A running re-sync, whoever started it, disables both and
shows its progress until it finishes or fails.

Needs @placeos/ts-client with sourceResync (PlaceOS/ts-client#33).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
backoffice Ready Ready Preview Oct 15, 2026 1:45am UTC

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@stakach
stakach marked this pull request as ready for review October 15, 2026 01:35
@stakach
stakach merged commit e8a7049 into develop Oct 15, 2026
6 of 9 checks passed
@stakach
stakach deleted the feat/database-mqtt-resync branch October 15, 2026 01:49

This branch was successfully deployed

1 active deployment
Preview — 43d2a902 Deployed Oct 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant