fix(mikrotikApplyService): filter routes by comment prefix when removing to ensure accurate route deletion
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m55s

This commit is contained in:
2026-02-03 21:43:08 +07:00
parent 6e4a0aae27
commit 99c027f96f
+3 -2
View File
@@ -270,8 +270,9 @@ async function applyOperation(client, op, dryRun) {
if (path === '/ip/route') {
if (action === 'remove' && meta?.findComment) {
const existing = await rosPrintWithQuery(client, '/ip/route', [`~comment=${meta.findComment}`]);
const toRemove = existing;
// REST API может игнорировать regex в .query и возвращать все маршруты — фильтруем на нашей стороне
const raw = await rosPrintWithQuery(client, '/ip/route', [`~comment=${meta.findComment}`]);
const toRemove = raw.filter(r => (r.comment || '').startsWith('Recursive: '));
if (toRemove.length === 0) {
result.status = 'skip';
result.details = 'No matching routes to remove';