Skip to content

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.79%. Comparing base (006cdab) to head (9f4ef25).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master      #68      +/-   ##
============================================
- Coverage     93.88%   93.79%   -0.10%     
- Complexity      461      470       +9     
============================================
  Files            72       73       +1     
  Lines          1620     1643      +23     
============================================
+ Hits           1521     1541      +20     
- Misses           99      102       +3     

☔ 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.

@KristianH KristianH changed the title chore: add exception message for invalid path value fix: add exception message for invalid path value Sep 5, 2025
@KristianH KristianH force-pushed the feature/add-error-message-for-link-path branch from 5ea84d2 to fabf6cc Compare September 5, 2025 12:06
@KristianH
Copy link
Contributor Author

@silasjoisten I added exception messages where it made sense. Assert::keyExists(...) has a good exception messaging already.

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