Skip to content

Conversation

@RichDom2185
Copy link
Member

Description

Cookies were being set from the API response but not being sent back in the cross-origin request because of unset credentials: true in fetch options, thus sticky sessions/session affinity wasn't working.

This PR adds a support to always force inclusion of such credentials via an environment variable, to keep it configurable on a per-deployment basis.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Code quality improvements

Checklist

  • I have tested this code
  • I have updated the documentation

@RichDom2185 RichDom2185 requested a review from sayomaki November 9, 2025 13:21
@RichDom2185 RichDom2185 self-assigned this Nov 9, 2025
@RichDom2185 RichDom2185 enabled auto-merge (squash) November 9, 2025 13:21
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19209107028

Details

  • 2 of 3 (66.67%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.005%) to 39.81%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/commons/utils/RequestHelper.tsx 1 2 50.0%
Totals Coverage Status
Change from base Build 19206312760: 0.005%
Covered Lines: 4845
Relevant Lines: 11257

💛 - Coveralls

Copy link
Contributor

@sayomaki sayomaki left a comment

Choose a reason for hiding this comment

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

LGTM, although I'm not sure if this will work. Will need to test with multiple backend instances to confirm.

@RichDom2185 RichDom2185 merged commit 302293f into master Nov 9, 2025
9 checks passed
@RichDom2185 RichDom2185 deleted the sticky-sessions branch November 9, 2025 14:35
RichDom2185 added a commit to NUS-CS1101S/cadet-frontend that referenced this pull request Nov 9, 2025
* Add new environment variable

* Update example .env file
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.

4 participants