Skip to content

Aggregate feature flag is contradictory — backend disabled, frontend enable #23

Description

@GziXnine

The aggregate router is commented out in the backend (main.py lines 89–96) with a # TEMPORARILY DISABLED comment, but the frontend config has ui.aggregate_enabled: true and there are ~280 lines of client code in src/services/aggregateApi.js that call endpoints which don't exist.

This means a contributor could wire up aggregate UI, watch it fail with 404s, and not understand why.

Current state

Layer File Status
Backend import main.py line 5 # , aggregate — commented out
Backend router main.py lines 89–96 Entire app.include_router(aggregate.router) block commented out
Backend config config.yamlaggregate.enabled false
Frontend config config.yamlui.aggregate_enabled true ← contradicts backend
Frontend API client src/services/aggregateApi.js 280 lines, calls /api/aggregate/...
Frontend hook src/hooks/useAggregatedData.js Ready to use
Backend router file fhir-backend-dynamic/app/routers/aggregate.py Exists, never loaded
Backend service file fhir-backend-dynamic/app/services/aggregation.py Exists, never called

What to do

Pick one of two approaches — don't leave it in this half-state.

Option A: Re-enable behind the existing feature flag

The guard logic is already written — it just needs uncommenting:

# main.py — uncomment line 5:
from app.routers import resources, health, servers, filters, metadata, aggregate

# main.py — uncomment lines 89-96:
if config.aggregate_enabled:
    try:
        app.include_router(aggregate.router, prefix="/api")
        logging.info("Aggregate endpoints enabled successfully")
    except Exception as e:
        logging.error(f"Failed to include aggregate router: {e}")

Then align the config: set ui.aggregate_enabled to match aggregate.enabled (both false by default, both true to test).

If there are runtime errors when enabled, file them as separate issues instead of commenting out the whole feature.

Option B: Mark it experimental explicitly

Move the frontend aggregate files into src/experimental/ so they're clearly separated from production code. Add a note in README.md stating the feature is under development.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions