[PR #7979] [MERGED] fix(chats): restore message and swipe state on bulk visibility failure #8037

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7979
Author: @minikkeuen
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @SpicyMarinara

Base: staging ← Head: pr/bulk-visibility-staging


📝 Commits (1)

  • 5745b91 fix: restore exact message and swipe extras on bulk visibility failure

📊 Changes

2 files changed (+118 additions, -67 deletions)

View changed files

📝 packages/server/src/services/storage/chats.storage.ts (+29 -67)
➕ scripts/regressions/data-integrity-bulk-hidden.regression.ts (+89 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7978

Why this change

  • A storage failure during a bulk message visibility update can leave message and swipe metadata partially modified.
  • The existing rollback logic records a message only after its visibility and swipe updates have completed.
  • If a swipe update fails midway, the current message may not be included in the rollback, leaving its state inconsistent.

What changed

  • Preserve the original message visibility and swipe metadata before applying bulk updates.
  • Restore the exact original message and swipe state when an operation fails, including partially processed messages.
  • Ensure rollback covers related metadata rather than restoring only visibility flags.
  • Add a regression test that injects a storage failure during a bulk visibility update and verifies state restoration.
  • Preserve existing behavior for successful bulk visibility operations.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Additional automated validation:

  • Bulk visibility rollback regression test passed.
  • Additional TypeScript checks passed.
  • Changes were applied to the latest upstream/staging without merge conflicts.

Manual verification notes

  • Browser-based manual verification has not been performed.
  • Automated regression testing covered failure during swipe updates and restoration of message and swipe metadata.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

No screenshots or recordings are available. This change affects server-side rollback behavior and does not introduce UI changes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7979 **Author:** [@minikkeuen](https://github.com/minikkeuen) **Created:** 10/21/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `pr/bulk-visibility-staging` --- ### 📝 Commits (1) - [`5745b91`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5745b91d8d17a57b2ac25e8ce4d05d04c8325f30) fix: restore exact message and swipe extras on bulk visibility failure ### 📊 Changes **2 files changed** (+118 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/storage/chats.storage.ts` (+29 -67) ➕ `scripts/regressions/data-integrity-bulk-hidden.regression.ts` (+89 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #7978 ## Why this change - A storage failure during a bulk message visibility update can leave message and swipe metadata partially modified. - The existing rollback logic records a message only after its visibility and swipe updates have completed. - If a swipe update fails midway, the current message may not be included in the rollback, leaving its state inconsistent. ## What changed - Preserve the original message visibility and swipe metadata before applying bulk updates. - Restore the exact original message and swipe state when an operation fails, including partially processed messages. - Ensure rollback covers related metadata rather than restoring only visibility flags. - Add a regression test that injects a storage failure during a bulk visibility update and verifies state restoration. - Preserve existing behavior for successful bulk visibility operations. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` Additional automated validation: - Bulk visibility rollback regression test passed. - Additional TypeScript checks passed. - Changes were applied to the latest `upstream/staging` without merge conflicts. ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Browser-based manual verification has not been performed. - Automated regression testing covered failure during swipe updates and restoration of message and swipe metadata. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) No screenshots or recordings are available. This change affects server-side rollback behavior and does not introduce UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:51 +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#8037
No description provided.