Skip to content

MS: User Tasks with Space and User Data Access#730

Open
jjoderis wants to merge 12 commits intomainfrom
ms/user-task-data-access
Open

MS: User Tasks with Space and User Data Access#730
jjoderis wants to merge 12 commits intomainfrom
ms/user-task-data-access

Conversation

@jjoderis
Copy link
Copy Markdown
Contributor

Summary

Added handling of global data from a space in the MS in User Tasks in the MS task list.

Details

  • added logic that will inline space data into user task html when it is required in a placeholder in the html
    • this works both for tasks in the task list as well as for start forms

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

CLOUDRUN ACTIONS

✅ Successfully created Preview Deployment.

https://pr-730---ms-server-staging-c4f6qdpj7q-ew.a.run.app

varPath = varPath.split('.').slice(1).join('.');
} else {
throw new Error(`Unable to get data for global variable (@global.${varPath}).`);
return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Wouldn't throwing an error be a better approach instead of simply returning?


const startInstance = async (versionId: string, variables: { [key: string]: any } = {}) => {
if (engines?.length)
if (engines?.length) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it prevents attempting to start an instance when no engines are available.

So the question is: should this throw an error instead of silently returning undefined? Alternatively, if we are confident that an engine will always be available, we might even remove the if check.

I mean the if check seems unnecessary here. isn't it?

} else if (segments[0] === '@worker' || !segments[0].startsWith('@')) {
({ userId } = await getCurrentUser());
} else if (segments[0] !== '@organization') {
console.error(`Invalid selector for global data access in user task html. (${segments[0]})`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why don't we throw an error here instead of logging?


if (isErrorResponse(result)) {
console.error(
'Ecountered error while trying to get global variable for user task rendering:',
Copy link
Copy Markdown
Contributor

@Zayn-Javed Zayn-Javed Apr 8, 2026

Choose a reason for hiding this comment

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

same question as above. also the error string has minor typo: Ecountered

Copy link
Copy Markdown
Contributor

@Zayn-Javed Zayn-Javed left a comment

Choose a reason for hiding this comment

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

very well. please have a look at these minor things.

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.

2 participants