[GH-ISSUE #7978] [Issue]: Failed bulk message visibility updates can leave message and swipe metadata inconsistent #4377

Closed
opened 2026-10-22 04:06:09 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @minikkeuen on GitHub (Oct 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7978

Originally assigned to: @SpicyMarinara on GitHub.

Summary

A failure during a bulk message visibility update can leave message and swipe metadata partially modified because the rollback does not fully restore the message being processed when the error occurs.

Expected behavior

  • If a bulk visibility update fails, all affected messages should be restored to their original visibility state.
  • Swipe metadata and related message properties should also be restored.
  • A failed operation should not leave partially modified message data.

Actual behavior

  • Messages are added to the rollback list only after their message and swipe updates have completed.
  • If an error occurs while updating swipe metadata, the current message may already have been modified but is not included in the rollback list.
  • Previously processed messages may be restored while the current message and its swipe metadata remain inconsistent.

Steps to reproduce

This issue was identified through source-code inspection and reproduced using an automated regression test with an injected storage failure.

  1. Create a chat containing multiple messages, including messages with multiple swipes.
  2. Start a bulk visibility update affecting several messages.
  3. Inject a storage failure while updating the swipe metadata of one message.
  4. Observe that the operation fails and attempts to roll back previous changes.
  5. Verify that the message being processed when the failure occurred is not fully restored to its original state.

Environment

  • Marinara Engine version: v2.5.1
  • Install type: source
  • OS + version: macOS 26.6.2 (Apple Silicon)
  • Browser or app shell: Local web interface

Logs, screenshots, or video

No browser screenshots or runtime error logs are available.

The issue was identified through source-code inspection and reproduced using a failure-injection regression test.

Additional context

The affected implementation is in:

packages/server/src/services/storage/chats.storage.ts

The rollback logic records successfully processed messages but does not fully account for partial changes to the message currently being updated.

The proposed fix restores the original message visibility, swipe metadata, and related properties when a bulk operation fails, without changing normal successful operations.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @minikkeuen on GitHub (Oct 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7978 Originally assigned to: @SpicyMarinara on GitHub. ## Summary A failure during a bulk message visibility update can leave message and swipe metadata partially modified because the rollback does not fully restore the message being processed when the error occurs. ## Expected behavior - If a bulk visibility update fails, all affected messages should be restored to their original visibility state. - Swipe metadata and related message properties should also be restored. - A failed operation should not leave partially modified message data. ## Actual behavior - Messages are added to the rollback list only after their message and swipe updates have completed. - If an error occurs while updating swipe metadata, the current message may already have been modified but is not included in the rollback list. - Previously processed messages may be restored while the current message and its swipe metadata remain inconsistent. ## Steps to reproduce This issue was identified through source-code inspection and reproduced using an automated regression test with an injected storage failure. 1. Create a chat containing multiple messages, including messages with multiple swipes. 2. Start a bulk visibility update affecting several messages. 3. Inject a storage failure while updating the swipe metadata of one message. 4. Observe that the operation fails and attempts to roll back previous changes. 5. Verify that the message being processed when the failure occurred is not fully restored to its original state. ## Environment - Marinara Engine version: v2.5.1 - Install type: source - OS + version: macOS 26.6.2 (Apple Silicon) - Browser or app shell: Local web interface ## Logs, screenshots, or video No browser screenshots or runtime error logs are available. The issue was identified through source-code inspection and reproduced using a failure-injection regression test. ## Additional context The affected implementation is in: `packages/server/src/services/storage/chats.storage.ts` The rollback logic records successfully processed messages but does not fully account for partial changes to the message currently being updated. The proposed fix restores the original message visibility, swipe metadata, and related properties when a bulk operation fails, without changing normal successful operations. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-24 04:03:38 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4377
No description provided.