Skip to content

Fix Device based MCP error log in app log#6587

Merged
hardillb merged 6 commits intomainfrom
6586-mcp-errors
Jan 29, 2026
Merged

Fix Device based MCP error log in app log#6587
hardillb merged 6 commits intomainfrom
6586-mcp-errors

Conversation

@Steve-Mcl
Copy link
Copy Markdown
Contributor

@Steve-Mcl Steve-Mcl commented Jan 29, 2026

Description

  • add missing await to DB call
  • skip querying devices MCP tools (other parts of feature not ready yet)
  • dont permit invalid instances or types into the MCP Registrations
  • tests to prevent regression

Tests added

▼ MCP Server Registration
  ✔ should return 500 and log error for unknown device
  ✔ should return 500 and log error for unknown instance
  ✔ should return 500 and log error for unknown type

Related Issue(s)

closes #6586

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production
  • Link to Changelog Entry PR, or note why one is not needed.

Labels

  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl Steve-Mcl requested a review from hardillb January 29, 2026 09:15
Copy link
Copy Markdown
Contributor

@hardillb hardillb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs tests fixing

@Steve-Mcl
Copy link
Copy Markdown
Contributor Author

Needs tests fixing

Nice - the new logic to prevent invalid instances being added to MCPRegistrations table highlighted some bad unit tests - should be good now!

@hardillb
Copy link
Copy Markdown
Contributor

Will let the tests pass, but also not merging until other problems are fixed

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 29, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 76.66%. Comparing base (4bef29b) to head (5c285e8).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
forge/routes/api/expert.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6587      +/-   ##
==========================================
+ Coverage   76.61%   76.66%   +0.04%     
==========================================
  Files         398      398              
  Lines       20100    20103       +3     
  Branches     4839     4841       +2     
==========================================
+ Hits        15400    15411      +11     
+ Misses       4700     4692       -8     
Flag Coverage Δ
backend 76.66% <87.50%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Steve-Mcl
Copy link
Copy Markdown
Contributor Author

@hardillb the strictness of PG was overlooked (didnt like made up instance id xxxx-xxx-xxx) fixed last test in fix test for strict PG (should be valid UUID)

Good to go now

@hardillb hardillb merged commit 1fbb1cc into main Jan 29, 2026
27 checks passed
@hardillb hardillb deleted the 6586-mcp-errors branch January 29, 2026 12:51
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.

High volume of errors on MCP registration endpoint

2 participants