Skip to content

fix(logbook): resolve duplicated comments in add-content and logbook item components#592

Open
derangulacau wants to merge 2 commits intopaulscherrerinstitute:mainfrom
HayenNico:fix-duplicate-comments
Open

fix(logbook): resolve duplicated comments in add-content and logbook item components#592
derangulacau wants to merge 2 commits intopaulscherrerinstitute:mainfrom
HayenNico:fix-duplicate-comments

Conversation

@derangulacau
Copy link
Copy Markdown

Problem

Duplicate comments were being created when adding content via the logbook widget.

Observed behavior

  • First logbook: comment appears once
  • Subsequent logbooks: same comment appears multiple times

Root Cause

  • Multiple active RxJS subscriptions were not cleaned up
  • Each widget instance created additional subscriptions
  • submitContent() was triggered multiple times

Solution

  • Unsubscribed existing changeStream subscriptions before creating new ones
  • Cleaned up previous dataService message subscriptions
  • Restricted submission logic to the main widget (configIndex === 1)

Result

  • Only one active subscription handles events
  • Duplicate comment submissions are prevented

@derangulacau derangulacau requested a review from a team as a code owner April 22, 2026 13:10
@derangulacau derangulacau force-pushed the fix-duplicate-comments branch from f9b0050 to 1826dbe Compare April 22, 2026 15:50
@derangulacau derangulacau force-pushed the fix-duplicate-comments branch from 1826dbe to 57fbe02 Compare April 27, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants