Skip to content

fix: Store ID param sent to Content Platform client#3265

Merged
lucasfp13 merged 1 commit intomainfrom
fix/cp-store-id-param
Apr 9, 2026
Merged

fix: Store ID param sent to Content Platform client#3265
lucasfp13 merged 1 commit intomainfrom
fix/cp-store-id-param

Conversation

@lucasfp13
Copy link
Copy Markdown
Contributor

@lucasfp13 lucasfp13 commented Apr 9, 2026

What's the purpose of this pull request?

Fix the storeId param being sent to the Content Platform client requests, used to fetch entries and pages. We need to make sure look to the contentSource.project (in discovery config) to check if the project is using a store different than the old default one (faststore).

It will prevent errors when setting up new stores through WebOps onboarding (see image below).

Screenshot 2026-04-09 at 17 16 08

How it works?

Ensure the store ID is correctly read from contentSource.project when is set.

Summary by CodeRabbit

  • Refactor
    • Enhanced content source configuration handling to respect custom project settings when available, with automatic fallback to default behavior when not configured.

@lucasfp13 lucasfp13 self-assigned this Apr 9, 2026
@lucasfp13 lucasfp13 requested a review from a team as a code owner April 9, 2026 20:32
@lucasfp13 lucasfp13 added bug Something isn't working hotfix Address critical bugs that need to be fixed immediately labels Apr 9, 2026
@lucasfp13 lucasfp13 requested review from ommeirelles and renatamottam and removed request for a team April 9, 2026 20:32
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Walkthrough

Updated convertOptionsToParams function to dynamically derive storeId from config.contentSource.project when available, falling back to the hardcoded default 'faststore' value if absent. Single-file change with minimal scope.

Changes

Cohort / File(s) Summary
Dynamic Store ID Configuration
packages/core/src/server/content/service.ts
Modified convertOptionsToParams to use storeId from config.contentSource.project with fallback to 'faststore' instead of always using hardcoded value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Suggested reviewers

  • ommeirelles
  • eduardoformiga

Poem

🏪 The store ID now flows from config's gentle hand,
No longer bound by hardcoded sand,
Dynamic and free, it adapts with grace,
Finding its home in the right place. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: fixing the storeId parameter sent to the Content Platform client, which aligns with the file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cp-store-id-param

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Apr 9, 2026

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/core/src/server/content/service.ts`:
- Around line 190-192: The derivation of storeId using (config.contentSource as
Record<string, string>)?.project ?? 'faststore' is unsafe and doesn't guard
against empty/whitespace values; instead, explicitly narrow and validate
config.contentSource before reading .project (e.g., check typeof
config.contentSource === 'object' && config.contentSource !== null && 'project'
in config.contentSource), ensure the value is a non-empty trimmed string (reject
'' or whitespace), and fall back to 'faststore' if validation fails; apply the
same change consistently for the storeId logic in service.ts (symbol: storeId)
and cms/index.ts (the equivalent storeId computation) or extract a small helper
(e.g., getValidatedStoreId) and reuse it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5be84130-f4e4-437e-a080-7b9974d2e5cc

📥 Commits

Reviewing files that changed from the base of the PR and between 74fa742 and 7b7da87.

📒 Files selected for processing (1)
  • packages/core/src/server/content/service.ts

Comment thread packages/core/src/server/content/service.ts
Copy link
Copy Markdown
Contributor

@lemagnetic lemagnetic left a comment

Choose a reason for hiding this comment

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

lgtm

@lucasfp13 lucasfp13 requested review from eduardoformiga and removed request for renatamottam April 9, 2026 20:45
@lucasfp13 lucasfp13 merged commit 63fffd8 into main Apr 9, 2026
8 of 9 checks passed
@lucasfp13 lucasfp13 deleted the fix/cp-store-id-param branch April 9, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working hotfix Address critical bugs that need to be fixed immediately

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants