Skip to content

chore(fe): stop sending the retired X-Organization-ID header - #2452

Open
vecchp wants to merge 1 commit into
chore/perm-legacy-fixture-helperfrom
chore/fe-drop-org-header
Open

vecchp wants to merge 1 commit into
chore/perm-legacy-fixture-helperfrom
chore/fe-drop-org-header

Conversation

@vecchp

@vecchp vecchp commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

The backend no longer reads a request org anywhere — DEV-2566 (#2450) retired the X-Organization-ID header, its middleware, and every header-era fixture. This removes the dead FE-side injection so no client attaches a request org.

Stacks on #2451; must land after #2450 (i.e. after the backend stack) so no app deploy can be ahead of a backend that still required the header.

What changes

  • libs/fetch — delete createOrgInterceptor and its unit tests.
  • libs/ba-platform — drop the interceptor from the web and expo fetch clients and from the convenience re-exports.
  • The active-org store stays: it still drives the UI and the org query variables (useOrgTeams reads getActiveOrgId reactively); its rationale docstring now records the header's retirement instead of describing the interceptor.
  • web/expo fetch-client tests: header-injection cases removed.
  • ADR §7 (header-retirement note): the "FE may keep sending it" sentence updated to reflect the removal.

Test plan

  • ESLint clean on all changed files.
  • vitest on the fetch/ba-platform suites runs in CI (local container lacks the rolldown native binding).
  • No API/schema changes; backend is untouched.

Summary by Sourcery

Stop frontend fetch clients from sending the retired X-Organization-ID header.

Enhancements:

  • Remove frontend support for the retired X-Organization-ID request header while retaining the active-organization store for UI state and query scoping.

Documentation:

  • Update the authorization ADR to document that frontend clients no longer attach the retired organization header.

Tests:

  • Remove tests covering organization-header injection from the shared, web, and Expo fetch clients.

The backend no longer reads a request org anywhere (DEV-2566 retired the header
and its middleware), so the FE-side injection is dead weight: remove it.

- libs/fetch: delete `createOrgInterceptor` (+ its unit tests).
- libs/ba-platform: drop the interceptor from the web and expo fetch clients and
  from the convenience re-exports; the active-org store stays (it still drives
  the UI and the org query variables, e.g. `useOrgTeams`) and its rationale
  docstring now records the header's retirement.
- web/expo fetch-client tests: drop the header-injection cases.

Lands after the backend stack (#2450) so no client is ahead of a backend that
still needed the header. ESLint clean; vitest runs in CI (rolldown binding
unavailable in this container).

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @vecchp, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 4 days and 22 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This follow-up removes frontend injection of the retired X-Organization-ID header by deleting the shared interceptor, unlinking it from web and Expo clients and exports, and removing its tests while retaining the active-org store for UI and query-variable scoping.

File-Level Changes

Change Details Files
Removed the retired organization-header interceptor from the shared fetch layer and both platform clients.
  • Deleted createOrgInterceptor and its unit coverage.
  • Removed interceptor imports, composition, and convenience re-exports.
  • Updated web and Expo client chain documentation to reflect CSRF/credentials behavior only.
libs/fetch/src/lib/fetchInterceptors.ts
libs/fetch/src/lib/fetchInterceptors.test.ts
libs/ba-platform/src/lib/interceptors.ts
libs/ba-platform/web/src/lib/fetchClient.ts
libs/ba-platform/expo/src/lib/fetchClient.ts
Adjusted platform tests and active-organization documentation for the new request-scoping model.
  • Removed web and Expo assertions covering X-Organization-ID injection and omission.
  • Kept the active-org store for UI and query-variable consumers, documenting that it no longer feeds request headers.
libs/ba-platform/web/src/lib/fetchClient.test.ts
libs/ba-platform/expo/src/lib/fetchClient.test.ts
libs/ba-platform/src/lib/activeOrg/activeOrgStore.ts
Updated the authorization ADR to record that frontend clients no longer attach the retired header.
  • Replaced the note that FE clients may continue sending the ignored header with the completed cleanup status.
docs/adr/0001-grant-based-authorization.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

Copy link
Copy Markdown

🚀 Expo continuous deployment is ready for betterangels!

  • Project → betterangels
  • Environment → Preview
  • Platforms → android, ios
  • Scheme → betterangels
  🤖 Android 🍎 iOS
Runtime Version 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview
Runtime version: 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
App version: 1.2.11
Git commit: a1900145e6c2315da5a85930acd4fcf2f8619aa2
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview
Runtime version: 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
App version: 1.2.11
Git commit: a1900145e6c2315da5a85930acd4fcf2f8619aa2
Update Details Update Permalink
DetailsBranch: chore-fe-drop-org-header
Runtime version: 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
Git commit: ce84baaadb3528ee99d77246a92601fb07c3144c
Update Permalink
DetailsBranch: chore-fe-drop-org-header
Runtime version: 4d84f3f87051ebb9c1713e7e2d4522e4b23135d9
Git commit: ce84baaadb3528ee99d77246a92601fb07c3144c
Update QR

iOS Simulator Build: Simulator Build Link

@github-actions

Copy link
Copy Markdown

🔍 [shelter-web] Preview available at: https://shelter.dev.betterangels.la/branches/chore-fe-drop-org-header

Last updated: 2026-09-10T18:10:49.026Z

@github-actions

Copy link
Copy Markdown

🔍 [betterangels-admin] Preview available at: https://admin.dev.betterangels.la/branches/chore-fe-drop-org-header

Last updated: 2026-09-10T18:10:49.019Z

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