Skip to content

DEV: Prevent edge-cases in the Glimmer post stream #33847

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

Merged
merged 4 commits into from
Jul 25, 2025

Conversation

megothss
Copy link
Contributor

@megothss megothss commented Jul 24, 2025

This PR enhances the DecoratedHtml component by wrapping decorator functions in try/catch blocks. If an error occurs during decoration, it will be surfaced to the console in production but rethrown in test environments, preventing application crashes due to decorator failures.

Additionally, a minimum height is enforced for cloaked posts, preventing edge cases where posts without height wouldn't trigger the intersection observers.

megothss added 3 commits July 24, 2025 19:42
…` theme

Ensured `.post-stream--cloaked` elements have a `min-height` of `1px` to maintain proper functioning of intersection observers. This change prevents visual issues caused by cloaked items without a fixed height set.
…unctions

Wrapped `decorateFn` and `decorateAfterAdopt` calls in `try-catch` blocks to prevent application crashes caused by errors in decorator functions. Logged errors to the console while allowing execution to proceed unless in testing environments, where exceptions are re-thrown.
Set `model` to an empty object if not provided in `decorated-html` component constructor to avoid potential errors caused by undefined or missing `model`.
… constructor

This was breaking compatibility with the policy plugin
@megothss megothss merged commit 67ba21d into main Jul 25, 2025
28 of 29 checks passed
@megothss megothss deleted the dev/glimmer-post-stream-prevent-issues branch July 25, 2025 00:28
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.

2 participants