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

zehnder pushed a commit to branch 
4162-persist-pipeline-id-collision-when-creating-multiple-adapters-with-same-name
in repository https://gitbox.apache.org/repos/asf/streampipes.git


The following commit(s) were added to 
refs/heads/4162-persist-pipeline-id-collision-when-creating-multiple-adapters-with-same-name
 by this push:
     new a134ed886f fix(#4162): add random suffix to persist pipeline ID to 
avoid conflicts
a134ed886f is described below

commit a134ed886f6eda194e9d600b07a2d51f5ce55795
Author: Philipp Zehnder <[email protected]>
AuthorDate: Tue Feb 10 11:16:22 2026 +0100

    fix(#4162): add random suffix to persist pipeline ID to avoid conflicts
---
 .../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 66eefc0b93..e045eae295 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
@@ -288,15 +288,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);
@@ -337,8 +341,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,
@@ -393,10 +397,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(
@@ -413,7 +416,7 @@ export class AdapterStartedDialog implements OnInit {
                                 this.pipelineOperationStatus =
                                     pipelineOperationStatus;
                                 this.startAdapter(adapterElementId, true);
-                                this.addToAsset();
+                                this.addToAsset(pipelineId);
                             },
                             error => {
                                 this.onAdapterFailure(error.error);
@@ -455,4 +458,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