MS: User Tasks with Space and User Data Access#730
Conversation
…ery time a user task is opened to ensure that the the data of the current worker is always correctly inserted
…s/proceed into ms/user-task-data-access
…ons for organization and user data
This comment has been minimized.
This comment has been minimized.
| varPath = varPath.split('.').slice(1).join('.'); | ||
| } else { | ||
| throw new Error(`Unable to get data for global variable (@global.${varPath}).`); | ||
| return; |
There was a problem hiding this comment.
Wouldn't throwing an error be a better approach instead of simply returning?
There was a problem hiding this comment.
You are right. I changed this back to how it was before.
|
|
||
| const startInstance = async (versionId: string, variables: { [key: string]: any } = {}) => { | ||
| if (engines?.length) | ||
| if (engines?.length) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
You are right that this should not fail silently. I changed it to return a user facing error that informs the user that there is no engine to start the instance on.
| } 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]})`); |
There was a problem hiding this comment.
Why don't we throw an error here instead of logging?
There was a problem hiding this comment.
I changed this to throw a user facing error instead.
|
|
||
| if (isErrorResponse(result)) { | ||
| console.error( | ||
| 'Ecountered error while trying to get global variable for user task rendering:', |
There was a problem hiding this comment.
same question as above. also the error string has minor typo: Ecountered
There was a problem hiding this comment.
I changed this to throw a user facing error instead.
Zayn-Javed
left a comment
There was a problem hiding this comment.
very well. please have a look at these minor things.
This comment has been minimized.
This comment has been minimized.
…lead to a user readable error instead of silently failing
|
✅ Successfully created Preview Deployment. |
Summary
Added handling of global data from a space in the MS in User Tasks in the MS task list.
Details