Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nicknisi
Copy link
Member

@nicknisi nicknisi commented Aug 8, 2025

Summary

  • Fixed incorrect URL path for organization feature flags endpoint (changed feature_flags to feature-flags)
  • Updated corresponding tests to match the correct endpoint format

Test plan

  • Updated test URLs to use correct feature-flags path
  • Existing tests pass with corrected endpoint
  • Verified API endpoint consistency

Closes #1334

@nicknisi nicknisi requested a review from a team as a code owner August 8, 2025 18:43
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR fixes a critical bug in the WorkOS Node.js SDK where the listOrganizationFeatureFlags method was using an incorrect URL path format. The implementation was using feature_flags (with underscores) while the actual WorkOS API expects feature-flags (with hyphens), causing all calls to this endpoint to fail with 404 errors.

The changes are made in two files:

  1. organizations.ts: Updated the endpoint URL in the AutoPaginatable implementation on lines 122 and 129, changing /organizations/${organizationId}/feature_flags to /organizations/${organizationId}/feature-flags. Both occurrences needed to be updated - one for the initial fetch and one for the pagination callback function.

  2. organizations.spec.ts: Updated all corresponding test assertions on lines 464, 517, 540, and 563 to expect the correct hyphenated endpoint format, ensuring the test suite validates the proper API endpoint going forward.

This fix aligns the SDK with standard RESTful API conventions where resource names in URLs typically use hyphens rather than underscores, and more importantly, matches the actual WorkOS API specification. The change restores functionality for users who were experiencing failures when attempting to retrieve organization feature flags.

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it's a straightforward bug fix addressing a clear endpoint mismatch
  • Score reflects a simple, well-tested URL correction that directly fixes a broken API call without introducing complexity
  • No files require special attention as the changes are isolated to URL string corrections with matching test updates

2 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@nicknisi nicknisi force-pushed the nicknisi/1334-feature-flags branch from 0737f91 to e7d4f88 Compare August 8, 2025 21:27
@nicknisi nicknisi merged commit e2031b6 into main Aug 9, 2025
5 checks passed
@nicknisi nicknisi deleted the nicknisi/1334-feature-flags branch August 9, 2025 19:27
@nicknisi nicknisi mentioned this pull request Aug 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

listOrganizationFeatureFlags fails with 404 error

3 participants