-
Notifications
You must be signed in to change notification settings - Fork 68
feat: Concurrent executions with indexedDB Main Finalization #1328
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
base: feature/distributed-demo
Are you sure you want to change the base?
feat: Concurrent executions with indexedDB Main Finalization #1328
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Finalizes the implementation of concurrent Digital Twin execution with IndexedDB integration for local persistence. Users can now start multiple executions simultaneously, view execution history, and manage executions through new UI components. This builds on version 0.8 changes including settings menu and interface design updates.
Key Changes
- Adds IndexedDB service for execution history persistence
- Implements concurrent execution support with execution status tracking
- Adds new execution history UI components with log viewing capabilities
Reviewed Changes
Copilot reviewed 120 out of 125 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
servers/lib/test/integration/files.service.integration.spec.ts | Removes afterEach hook to fix test configuration |
client/test/unit/route/digitaltwins/execution/ExecutionUIHandlers.test.ts | Adds comprehensive tests for execution UI handlers |
client/test/unit/route/digitaltwins/execution/ExecutionStatusManager.test.ts | Updates import paths and adds type safety improvements |
client/test/unit/route/digitaltwins/execution/ExecutionButtonHandlers.test.ts | Updates imports and adds execution ID parameter support |
client/test/unit/model/backend/gitlab/execution/statusChecking.test.ts | Comments out null/undefined parameter tests |
client/test/unit/model/backend/gitlab/execution/logFetching.test.ts | Removes null project ID test case |
client/test/unit/database/digitalTwins.test.ts | Adds comprehensive IndexedDB service tests |
client/test/unit/components/PrivateRoute.test.tsx | Adds mocks for new execution history components |
client/test/preview/unit/util/*.test.ts | Updates import paths from preview/util to model/backend |
client/test/unit/components/execution/ExecutionHistoryList.test.tsx | Adds comprehensive tests for execution history UI component |
client/test/unit/components/asset/*.test.tsx | Updates component tests for new execution history functionality |
client/test/preview/unit/store/executionHistory.slice.test.ts | Adds comprehensive Redux slice tests |
client/test/preview/unit/store/Store.test.ts | Updates for new Redux state structure |
client/test/preview/unit/routes/digitaltwins/manage/*.test.tsx | Updates for new adapter pattern |
client/test/preview/unit/routes/digitaltwins/execute/*.test.tsx | Updates imports and adds execution history tests |
client/test/preview/integration/**/*.test.tsx | Updates integration tests for new execution patterns |
client/test/e2e/tests/*.test.ts | Adds end-to-end tests for concurrent execution |
client/src/util/digitalTwinAdapter.ts | Adds adapter pattern for bridging Redux state and business logic |
client/src/store/store.ts | Adds execution history slice to Redux store |
client/src/store/snackbar.slice.ts | Simplifies snackbar hide logic |
client/src/store/selectors/*.ts | Adds selectors for execution history and digital twin state |
client/src/route/digitaltwins/Snackbar.tsx | Updates import path for snackbar slice |
client/src/preview/store/cart.slice.ts | Updates import path for LibraryAsset |
Comments suppressed due to low confidence (2)
servers/lib/test/integration/files.service.integration.spec.ts:1
- The removal of afterEach hook may cause test isolation issues if mocks are not properly reset between tests. Consider adding this back or ensuring mock cleanup is handled elsewhere.
import { describe, it, expect, jest } from '@jest/globals';
client/test/unit/model/backend/gitlab/execution/logFetching.test.ts:1
- Removing the null projectId test case reduces coverage for error handling scenarios. This test case helps ensure the function gracefully handles missing project IDs.
import {
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
ignoredActions: [ | ||
'digitalTwin/setDigitalTwin', | ||
'assets/setAsset', | ||
'assets/setAsset', |
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'assets/setAsset' action is duplicated in the ignoredActions array. Remove the duplicate entry.
'assets/setAsset', |
Copilot uses AI. Check for mistakes.
|
||
if (typeof globalThis.structuredClone !== 'function') { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
globalThis.structuredClone = (obj: any): any => | ||
JSON.parse(JSON.stringify(obj)); | ||
} | ||
|
Copilot
AI
Oct 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The structuredClone polyfill implementation may not handle all edge cases that the native implementation does (e.g., circular references, complex objects). Consider using a more robust polyfill library or documenting the limitations.
if (typeof globalThis.structuredClone !== 'function') { | |
// eslint-disable-next-line @typescript-eslint/no-explicit-any | |
globalThis.structuredClone = (obj: any): any => | |
JSON.parse(JSON.stringify(obj)); | |
} | |
import structuredClonePolyfill from '@ungap/structured-clone'; | |
if (typeof globalThis.structuredClone !== 'function') { | |
globalThis.structuredClone = structuredClonePolyfill; | |
} |
Copilot uses AI. Check for mistakes.
@atomicgamedeveloper please add the following lines at the end of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atomicgamedeveloper thanks for the huge PR. Please see the comments. General suggestions.
- Please remove relative paths in imports.
- Where possible, move code to
model/
. For example, new code added inutil
can probably go intomodel/util
.
thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file can be moved out of preview/...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move the react components to src/components/...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mentioned about SnackBar component being used in other pages. Can this component be moved to src/components/
?
case 'success': | ||
executionStatus = ExecutionStatus.COMPLETED; | ||
break; | ||
return ExecutionStatus.COMPLETED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change would give linting error of too many return statements.
} | ||
export const getStatusDescription = (status: string): string => { | ||
switch (status.toLowerCase()) { | ||
case 'success': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to avoid too many return statements?
* Interface for execution history operations | ||
* Abstracts away the underlying storage implementation | ||
*/ | ||
export interface IExecutionHistory { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this interface be moved to model/backend/interfaces/execution.ts
?
/** | ||
* Represents the schema for the IndexedDB database | ||
*/ | ||
export interface IndexedDBSchema { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does not seem to have been used anywhere.
@@ -0,0 +1,59 @@ | |||
import DigitalTwin from 'model/backend/digitalTwin'; | |||
import { DigitalTwinData } from 'model/backend/gitlab/state/digitalTwin.slice'; | |||
import { initDigitalTwin } from 'preview/util/init'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove the dependency to preview code. Also this code can be placed in model/util
directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this go into model/backend/state
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can probably go into model/util/
Pull Request Template
Title
Finalize Implementation of Concurrent Digital Twin Execution with IndexedDB Integration
Type of Change
Description
This PR finalizes the implementation of the concurrent execution for Digital Twins with IndexedDB integration. Users can now start multiple executions of the same Digital Twin simultaneously, with execution history persisted in the browser's IndexedDB. The implementation includes a new execution history data model, IndexedDB service, and UI components to display and manage execution history.
New is that it merges recent changes of the up-coming version 0.8 of DTaaS such as settings menu and new interface design.
Working on Testing
Impact
Additional Information
This PR builds on top of #1235 by Microchesst.
Checklist