Skip to content

feat: new status manager (v4)#340

Closed
effie-ms wants to merge 22 commits intomainfrom
status-manager-v4
Closed

feat: new status manager (v4)#340
effie-ms wants to merge 22 commits intomainfrom
status-manager-v4

Conversation

@effie-ms
Copy link
Copy Markdown
Contributor

@effie-ms effie-ms commented Dec 26, 2025

Which Jira task is linked to this PR?

https://lifi.atlassian.net/browse/LF-17289

To test with widget: lifinance/widget#647

Why was it implemented this way?

This PR updates StatusManager with simplified execution tracking:

  • process array becomes actions array
  • actions store types and metadata, but no statuses (except isDone)
  • execution stores current process type, status, etc.

Checklist before requesting a review

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.

@effie-ms effie-ms self-assigned this Dec 26, 2025
): Promise<SDKError> => {
if (e instanceof SDKError) {
e.step = e.step ?? step
e.process = e.process ?? process
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Previously all the passed processes were the latest processes. Now we store them on execution level.

For debugging, one can take current step.execution.type and find a corresponding action by type.

Therefore passing down the action is excessive.

export type ExecutionUpdate = Partial<Omit<Execution, 'type' | 'status'>> & {
type: StepExecutionType
status: ExecutionStatus
action?: ExecutionAction
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Passing action is like findOrCreateProcess or updateProcess in the past - it adds a new action if it is not in the array yet, or overwrites specified fields of the existing action (without resetting unspecified ones).

txLink:
statusReceiving?.txLink ||
`${toChain.metamask.blockExplorerUrls[0]}tx/${statusReceiving?.txHash}`,
isDone: true,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

isDone: true corresponds to setting process status as "DONE" in the previous implementation.

// Change status to PENDING after resuming from FAILED
if (step.execution.status === 'FAILED') {
step.execution.startedAt = Date.now()
step.execution.status = 'PENDING'
Copy link
Copy Markdown
Contributor Author

@effie-ms effie-ms Jan 23, 2026

Choose a reason for hiding this comment

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

for failed status, process was also set to empty array in prepareRestart

)

if (isBridgeExecution) {
process = this.statusManager.updateProcess(step, process.type, 'DONE')
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Now execution can be "DONE" only in the very end. The intermediary "DONE" processes are marked as isDone: true in actions.

@effie-ms effie-ms marked this pull request as ready for review January 23, 2026 16:12
@effie-ms effie-ms requested a review from chybisov January 23, 2026 16:12
@effie-ms
Copy link
Copy Markdown
Contributor Author

The changes are partially applied here: #345
The rest - to be added with a different architecture.
Closing.

@effie-ms effie-ms closed this Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant