Skip to content
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

BUGFIX: Fusion avoid error on cache invalidation while developing #4838

Conversation

mhsdesign
Copy link
Member

Replaces #4509
Resolves #4415

After deleting a fusion file like BrandLogo.fusion one will face the error after booting flow and thus triggering the file monitor and its listeners: (even like a simple flow help)

Couldn't resolve realpath for: '/absolutePath/Code/core/Neos.NeosIo/Packages/Sites/Neos.NeosIo/Resources/Private/Fusion/Content/BrandLogo/BrandLogo.fusion'

This is caused as realpath returns false if the file was deleted, and we were to eager validating this. But as flows file monitor already returns absolute paths we can skip the realpath calculation here and move it to the ParserCache::cacheForFusionFile. Initially the call to realpath was made in a single place to avoid making to many assumptions about the form flow returned file paths.

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

Replaces neos#4509
Resolves neos#4415

After deleting a fusion file like `BrandLogo.fusion` one will face the error after booting flow and thus triggering the file monitor and its listeners: (even like a simple `flow help`)

```
Couldn't resolve realpath for: '/absolutePath/Code/core/Neos.NeosIo/Packages/Sites/Neos.NeosIo/Resources/Private/Fusion/Content/BrandLogo/BrandLogo.fusion'
```

This is caused as `realpath` returns false if the file was deleted, and we were to eager validating this. But as flows file monitor already returns absolute paths we can skip the realpath calculation here and move it to the `ParserCache::cacheForFusionFile`.
Initially the call to `realpath` was made in a single place to avoid making to many assumptions about the form flow returned file paths.
@mhsdesign mhsdesign force-pushed the bugfix/4415-fusion-error-on-dev-cache-invalidation-attempt-2 branch from c675950 to 5377b86 Compare January 16, 2024 15:24
Copy link
Member

@kdambekalns kdambekalns left a comment

Choose a reason for hiding this comment

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

👍 by 👀

@kitsunet kitsunet merged commit ec26823 into neos:8.0 Jan 16, 2024
7 checks passed
@mhsdesign mhsdesign deleted the bugfix/4415-fusion-error-on-dev-cache-invalidation-attempt-2 branch January 16, 2024 18:32
@mhsdesign
Copy link
Member Author

The thesis

flow already returns absolute file paths from the file monitor, so we don't have to call realpath.

was wrong. There will be symlinks instead of actual files which causes this regression:
#4915

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants