Conversation
…d subscriptions from firing workflow actions (#35422) DotWizardService shared a single output Subject across every open() call. When the user dismissed the wizard without submitting, the consumer's subscription stayed alive, and the next submission fired every leftover subscription in addition to the current one — causing workflow actions to be applied to unrelated content items the user never touched. Create a fresh Subject per open() call and expose a cancel() method that completes it without emitting. The wizard component calls cancel() on close so pending subscriptions unsubscribe cleanly. No consumer needs to change.
|
Claude finished @oidacra's task in 1m 24s —— View job PR Review
The fix is correct and the test coverage is thorough. A few things worth a second look: 1. Double-cancel on the submit path — comment claim untested at component level
2. In 3. // dot-wizard.service.ts:49
const output$ = this.currentOutput.asObservable() as unknown as Observable<T>;
4. The The core bug fix — per-invocation Subject, |
…, open()->open() spec, idempotency comment - Component spec: assert close() invokes DotWizardService.cancel() — locks in the visibleChange -> close -> cancel wiring that fixes the reported bug at the integration layer. - Service spec: cover open() called twice without cancel in between — exercises the defensive currentOutput?.complete() inside open(). - Document in close() that cancel() is a safe no-op on the submit path (sendValue() nullifies currentOutput first), so future changes to output$ ordering don't silently enable a double-emit.
Parent issue
Closes #35422
Summary
DotWizardServiceused a single sharedSubjectacross everyopen()invocation. When the user dismissed the wizard without submitting, the consumer's subscription stayed alive and fired on the next submission — causing workflow actions (e.g. Send for Review, Push Publish, comment & assign) to be applied to unrelated content items the user had never touched.open()now creates a freshSubjectand returns an isolated stream. A newcancel()method completes the current stream without emitting;output$()emits and completes. The wizard component callscancel()on close sotake(1)consumers unsubscribe cleanly.DotWizardServicerequired changes —DotWorkflowEventHandlerService,DotEmaWorkflowActionsService, and any other caller continue to work as before.Files changed
core-web/libs/data-access/src/lib/dot-wizard/dot-wizard.service.ts— per-invocationSubject, newcancel(), complete-on-emit semanticscore-web/libs/data-access/src/lib/dot-wizard/dot-wizard.service.spec.ts— new specs for cancel, cross-invocation isolation, and complete-after-outputcore-web/apps/dotcms-ui/src/app/view/components/_common/dot-wizard/dot-wizard.component.ts—close()notifies the service viacancel()Test plan
yarn nx test data-access --testPathPattern=dot-wizard— passesyarn nx test dotcms-ui --testPathPattern=dot-wizard.component— passesyarn nx lint data-access+yarn nx lint dotcms-ui— no new errorsyarn nx format:writeapplied to changed files/dotAdmin/#/c/c_Blog-Entries:Links
This PR fixes: #35422