Skip to content

fix(bamsec): backend opt-out check reads non-existent app.config instead of app.cfg #69

Done

Description

@mlgitdev

Description

In Api.get_bamsec() (app/api.py:173), the opt-out guard reads getattr(self._app, "config", {}).get("news", {}). On the real App instance (app/main.py:56), configuration is stored on self.cfg (Config), not self.config. getattr always returns {}, causing bamsec_enabled to default to True even when disabled by the user.

References: app/api.py:172-178, app/main.py:56, tests/test_bamsec.py:217,234

Steps to Reproduce

  1. Open Settings -> General, uncheck Enable BamSEC Filings, and click Save Settings.
  2. Call GET /api/bamsec?ticker=AAPL.
  3. Observe the backend still makes outbound HTTP requests to bamsec.com and returns live filings instead of {"disabled": true}.

Expected Behavior

Api.get_bamsec() should read self._app.cfg.get().get("news", {}) (with safe fallback) and immediately return {"disabled": True, "total": 0, ...} when bamsec_enabled is False.

Operating System & Version

  • OS: Windows 11 x64 / macOS arm64 / Linux x86_64
  • Version: v2.12.0
  • Display / Scale: Verified via live Chrome CDP (1600x960) & local unit/backend suite

Logs & Additional Context

Live CDP test with bamsec_enabled=false returned {'disabled': False, 'ticker': 'AAPL', 'total': 42}.

Activity

  1. added
    bug
    on Dec 2, 2026
  2. self-assigned this
    on Dec 2, 2026
  3. mlgitdev commented on Dec 2, 2026

    @mlgitdev
    OwnerAuthor

    🚀 Resolution In Progress

    A fix for this issue has been implemented and submitted in Pull Request #82 (v2.12.1).

    This issue will automatically close upon PR #82 review and merge into main.

  4. github-actions commented on Dec 2, 2026

    @github-actions

    ✅ Issue Validation Passed

    • Conventional Commit title syntax (fix(bamsec))
    • Verified issue type: BUG
    • Required template sections present and filled out

    This issue is well-structured and ready for work according to the Issue-First Protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions