This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to refs/heads/dev by this push:
     new 67d297e923 fix(#4162): add random suffix to persist pipeline ID to 
avoid conflicts (#4163)
67d297e923 is described below

commit 67d297e923b2d62c7781149aef82cc0883ba16a9
Author: Philipp Zehnder <[email protected]>
AuthorDate: Tue Feb 17 08:23:35 2026 +0100

    fix(#4162): add random suffix to persist pipeline ID to avoid conflicts 
(#4163)
---
 .../adapter-started-dialog.component.ts            | 25 +++++++++++++++-------
 1 file changed, 17 insertions(+), 8 deletions(-)

diff --git 
a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts 
b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
index 90c90fc5d9..0be48870d2 100644
--- 
a/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
+++ 
b/ui/src/app/connect/dialog/adapter-started/adapter-started-dialog.component.ts
@@ -310,15 +310,19 @@ export class AdapterStartedDialog implements OnInit {
         this.shepherdService.trigger('confirm_adapter_started_button');
     }
 
-    async addToAsset(): Promise<void> {
+    async addToAsset(pipelineId = ''): Promise<void> {
         let linkageData: LinkageData[];
         try {
             if (!this.editMode) {
                 const adapter = await this.getAdapter();
                 linkageData = this.createLinkageData(adapter);
 
-                if (this.saveInDataLake) {
-                    await this.addDataLakeLinkageData(adapter, linkageData);
+                if (this.saveInDataLake && pipelineId !== '') {
+                    await this.addDataLakeLinkageData(
+                        adapter,
+                        linkageData,
+                        pipelineId,
+                    );
                 }
             } else {
                 linkageData = this.createLinkageData(this.adapter);
@@ -359,8 +363,8 @@ export class AdapterStartedDialog implements OnInit {
     private async addDataLakeLinkageData(
         adapter: AdapterDescription,
         linkageData: LinkageData[],
+        pipelineId: string,
     ): Promise<void> {
-        const pipelineId = `persist-${this.adapter.name.replaceAll(' ', '-')}`;
         linkageData.push({
             type: 'pipeline',
             id: pipelineId,
@@ -415,10 +419,9 @@ export class AdapterStartedDialog implements OnInit {
                 .findById('sp-internal-persist')
                 .subscribe(
                     template => {
+                        const pipelineId = this.createPipelineId();
                         const pipeline: CompactPipeline = {
-                            id:
-                                'persist-' +
-                                this.adapter.name.replaceAll(' ', '-'),
+                            id: pipelineId,
                             name: 'Persist ' + this.adapter.name,
                             description: '',
                             pipelineElements: this.makeTemplateConfigs(
@@ -435,7 +438,7 @@ export class AdapterStartedDialog implements OnInit {
                                 this.pipelineOperationStatus =
                                     pipelineOperationStatus;
                                 this.startAdapter(adapterElementId, true);
-                                this.addToAsset();
+                                this.addToAsset(pipelineId);
                             },
                             error => {
                                 this.onAdapterFailure(error.error);
@@ -477,4 +480,10 @@ export class AdapterStartedDialog implements OnInit {
         });
         return template;
     }
+
+    private createPipelineId(): string {
+        const base = `persist-${this.adapter.name.replaceAll(' ', '-')}`;
+        const suffix = Math.random().toString(36).slice(2, 8);
+        return `${base}-${suffix}`;
+    }
 }

Reply via email to