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

hotfix: processTemplateWithoutRender issue #2583

Closed
wants to merge 4 commits into from

Conversation

jfmcquade
Copy link
Collaborator

@jfmcquade jfmcquade commented Dec 2, 2024

PR Checklist

  • PR title descriptive (can be used in release notes)

Description

A hotfix for an issue where any templates processed without being rendered (e.g. startup templates, which are processed on app start without rendering), would throw an error. This is a regression issue introduced by #2531. See this mattermost thread for an identification of the issue.

Dev Notes

Error log on master, for plh_kids_tz deployment:

Screenshot 2024-12-02 at 14 04 05

The issue arises when we try to instantiate a template container component programmatically, outside of Angular's component lifecycle, as we do in the TemplateProcessService.processTemplateWithoutRender() method (which is called to handle lifecycle action templates). In that case, the effect() in the component's constructor, introduced in #2531, throws an error.

Git Issues

Closes #

Screenshots/Videos

If useful, provide screenshot or capture to highlight main changes

Copy link
Collaborator

@esmeetewinkel esmeetewinkel left a comment

Choose a reason for hiding this comment

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

Functional test passed - I can confirm this resolves the issue on my end

Copy link
Member

@chrismclarke chrismclarke left a comment

Choose a reason for hiding this comment

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

Interesting issue, didn't realise how angular signals interop with injection contexts but it makes sense.

Nice workaround to provide a static option within the constructor, although I found a slightly simpler solution from the signal code as it contains options to manually specify the injector, which we happen to be passing anyways when creating standalone.

I've opened up an alternate pr #2588 to do this, which will supercede this PR if you're happy with the change

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.

3 participants