Skip to content

chore: add exception message for invalid path value #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

KristianH
Copy link
Contributor

TL;DR

Note

I encountered a strange bug related to a Story in Storyblok. This PR might help identify the root cause.

Long Version

In the Storyblok API responses (both Management API and Content Delivery API), the path value was returned as an empty string ("") instead of null.Running the following command resulted in an error:

symfony console registries:setup

Which produced:

In Assert.php line 2074:

Expected a different value than "".

As a result, many links were missing in the LinkRegistry, which is part of the storyblok/symfony-bundle.

How to Fix This in Storyblok

Review the Content Delivery API response from Retrieve Multiple Links, for example:

https://api.storyblok.com/v2/cdn/links/?version=draft&token={YOUR_TOKEN}&per_page=1000

Look for entries where "path": "" (the expected default is "path": null).Delete and recreate the affected stories in the Storyblok editor.

Final Note

I'm not sure whether this bug is easily reproducible in Storyblok — and I didn’t want to risk reproducing it in a production environment.
For context: the affected story had its first_published_at value changed, and multi-language support was enabled.

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.88%. Comparing base (006cdab) to head (5ea84d2).

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #68   +/-   ##
=========================================
  Coverage     93.88%   93.88%           
- Complexity      461      462    +1     
=========================================
  Files            72       72           
  Lines          1620     1620           
=========================================
  Hits           1521     1521           
  Misses           99       99           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@edodusi edodusi left a comment

Choose a reason for hiding this comment

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

To me this looks legit. I would suggest to change the commit prefix from chore to fix because this will likely be released as a patch.

@silasjoisten
Copy link
Collaborator

Yes and please add proper exception messages to all the other Asserts too.

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.

5 participants