Skip to content

fix(tables): make the feature-gate 404 message explicit - #7994

Merged
andypalmi merged 1 commit into
mainfrom
fix/tables-feature-gate-error-message
Jul 28, 2026
Merged

fix(tables): make the feature-gate 404 message explicit#7994
andypalmi merged 1 commit into
mainfrom
fix/tables-feature-gate-error-message

Conversation

@andypalmi

Copy link
Copy Markdown
Contributor

Summary

When FlowFuse Tables isn't enabled for a team's plan, every route under /api/v1/teams/:teamId/databases returns a plain 404: { code: 'not_found', error: 'Not Found - not available on team' }. This is indistinguishable from a genuine "that database/table doesn't exist" response.

This came up while adding FlowFuse Tables as an MCP tool for Expert (see #7990): an LLM agent calling these tools has no signal that the feature simply isn't enabled versus the resource not existing, so it can't usefully tell the user "enable Tables for your team" instead of "that doesn't exist".

We discussed two options: augmenting the response with a new reason/reasonCode field (backward compatible, but introduces a new convention with no precedent in the codebase), versus just making the existing message explicit. Went with the latter since it's a plain string with no established contract around its exact wording, matches the clearest existing precedent (forge/routes/api/assistant.js:185), and needs no new convention.

Status code and code field are unchanged, only the error message now names the feature.

Test plan

  • Lint passes
  • No existing test asserts the old message text

Callers previously received the same generic 'Not Found - not available
on team' message whether a database genuinely didn't exist or the team's
plan simply doesn't include FlowFuse Tables, with no way to tell the two
apart. The message now names the feature and states it isn't enabled,
while the status code and code field are unchanged.
@andypalmi
andypalmi removed the request for review from hardillb July 28, 2026 12:58
@andypalmi
andypalmi enabled auto-merge (squash) July 28, 2026 12:58
@andypalmi
andypalmi disabled auto-merge July 28, 2026 13:02
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 75.86%. Comparing base (5f34bbf) to head (4b1e067).

Files with missing lines Patch % Lines
forge/ee/routes/tables/index.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7994   +/-   ##
=======================================
  Coverage   75.86%   75.86%           
=======================================
  Files         434      434           
  Lines       23340    23340           
  Branches     6209     6209           
=======================================
  Hits        17708    17708           
  Misses       5632     5632           
Flag Coverage Δ
backend 75.86% <0.00%> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@andypalmi
andypalmi merged commit ca3c665 into main Jul 28, 2026
29 checks passed
@andypalmi
andypalmi deleted the fix/tables-feature-gate-error-message branch July 28, 2026 13:12
@Steve-Mcl
Steve-Mcl self-requested a review July 28, 2026 13:13
@andypalmi andypalmi self-assigned this Jul 28, 2026
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.

2 participants