Skip to content

🔖(minor) release version 0.5.0#593

Merged
jbpenrath merged 2 commits into
mainfrom
release/0.5.0
Mar 16, 2026
Merged

🔖(minor) release version 0.5.0#593
jbpenrath merged 2 commits into
mainfrom
release/0.5.0

Conversation

@jbpenrath
Copy link
Copy Markdown
Contributor

@jbpenrath jbpenrath commented Mar 16, 2026

Purpose

Update all version files and changelog for minor release.

Release version 0.5.0

Added

Changed

Fixed

  • Make DNS checking more resilient
  • Remove mailbox.id from metrics

Summary by CodeRabbit

  • New Features

    • Auto-reply management per mailbox (create/edit/delete/activate) and scheduling
    • Thread splitting, starring/unstarring, active filter display, unread counts, date/time range selection
  • Bug Fixes

    • UI now properly clears thread selection and updates stats when removing your own mailbox access
  • Documentation

    • Updated changelog for v0.5.0
  • Chores

    • Version bumped to 0.5.0
    • Expanded language support (FR, NL, RU, UK)

@jbpenrath jbpenrath self-assigned this Mar 16, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

This PR releases version 0.5.0: bumps package versions, updates CHANGELOG.md, and updates localization files (fr, nl, ru, uk). It also adds a small frontend behavior change in thread-accesses-widget to handle self-removal cleanup.

Changes

Cohort / File(s) Summary
Release metadata & changelog
CHANGELOG.md, src/backend/pyproject.toml, src/e2e/package.json, src/frontend/package.json, src/mta-in/pyproject.toml, src/mta-out/pyproject.toml
Bump versions from 0.4.0 → 0.5.0 across packages and add a new 0.5.0 entry in the changelog.
Frontend localization — French
src/frontend/public/locales/common/fr-FR.json
Adjust plural translations for occurrence-related keys (e.g., "{{count}} occurrence(s)" → "{{count}} événement(s)").
Frontend localization — Dutch
src/frontend/public/locales/common/nl-NL.json
Add selected-threads plurals and several UI strings; remove multiple bulk-thread plural keys and related placeholder messages.
Frontend localization — Russian / Ukrainian
src/frontend/public/locales/common/ru-RU.json, src/frontend/public/locales/common/uk-UA.json
Add extensive new translation keys for starred/unread counts, auto-replies lifecycle, filter UI, date/time labels and validations, day names, thread-splitting messages, and related loading/error strings; remove some thread bulk-action keys.
Thread access widget behavior
src/frontend/src/features/layouts/components/thread-view/components/thread-accesses-widget/index.tsx
Enhance onSuccess handling for access deletion to detect self-removal and, if so, close share modal, invalidate thread messages with delete metadata, invalidate thread stats, and unselect the current thread.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Crowdin/setup #352 — Touches the same thread-accesses-widget/index.tsx and adjusts role/label rendering and i18n in the same component.
  • Front/fold message quotes #382 — Modifies onSuccess handling and thread invalidation logic in thread-accesses-widget/index.tsx.
  • Ci/push fr translations #367 — Updates frontend locale files (including fr-FR.json) and translation assets related to this PR.

Suggested reviewers

  • sylvinus

Poem

🐰
Hop, hop—version five arrives today,
I stitched new strings in many a way.
Threads unshared, translations bloom,
Changelog cheer fills every room,
A carrot-coded release—hip hip hooray! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly summarizes the main change: bumping the version to 0.5.0 for a minor release and updating all related files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release/0.5.0
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/frontend/public/locales/common/ru-RU.json`:
- Line 238: The translation for the "End date" key is using the dative case
("Дате окончания"); update the JSON value for the "End date" key to the
nominative form "Дата окончания" so the label reads correctly (locate the "End
date" key in src/frontend/public/locales/common/ru-RU.json and replace its
value).
- Around line 493-494: The Russian translations for the keys "Split thread" and
"Split thread from here" use the plural "обсуждения" but should be singular;
update the JSON values so "Split thread" => "Разделить обсуждение" and "Split
thread from here" => "Разделить обсуждение с этого места" to ensure correct
grammatical number for single-thread actions (edit the entries for the keys
"Split thread" and "Split thread from here" in
src/frontend/public/locales/common/ru-RU.json).
- Line 501: The "Start day" translation is identical to "Start date" and should
be differentiated; update the JSON entry with key "Start day" (currently "Дата
начала") to the suggested "День начала" so it matches the Ukrainian distinction
and the scheduling UI semantics.

In `@src/frontend/public/locales/common/uk-UA.json`:
- Line 287: The translation value for the "Friday" key contains a backtick
instead of an apostrophe; locate the "Friday" JSON entry (currently "П`ятниця")
and replace the backtick with a proper apostrophe character so the value becomes
"П'ятниця" to fix rendering and search/sort issues.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 73207565-09e8-4b62-a71c-d4a3f66c4a7f

📥 Commits

Reviewing files that changed from the base of the PR and between 17ffd3f and 22402d0.

⛔ Files ignored due to path filters (5)
  • src/backend/uv.lock is excluded by !**/*.lock
  • src/e2e/package-lock.json is excluded by !**/package-lock.json
  • src/frontend/package-lock.json is excluded by !**/package-lock.json
  • src/mta-in/uv.lock is excluded by !**/*.lock
  • src/mta-out/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • CHANGELOG.md
  • src/backend/pyproject.toml
  • src/e2e/package.json
  • src/frontend/package.json
  • src/frontend/public/locales/common/fr-FR.json
  • src/frontend/public/locales/common/nl-NL.json
  • src/frontend/public/locales/common/ru-RU.json
  • src/frontend/public/locales/common/uk-UA.json
  • src/mta-in/pyproject.toml
  • src/mta-out/pyproject.toml

"Edit Widget": "Настроить виджет",
"Email address": "Адрес электронной почты",
"EML, MBOX or PST": "EML, MBOX или PST",
"End date": "Дате окончания",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Grammatical error: wrong case in "End date" translation.

"Дате окончания" uses dative case but should be nominative "Дата окончания" to match the label context.

🔤 Suggested fix
-  "End date": "Дате окончания",
+  "End date": "Дата окончания",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"End date": "Дате окончания",
"End date": "Дата окончания",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/public/locales/common/ru-RU.json` at line 238, The translation
for the "End date" key is using the dative case ("Дате окончания"); update the
JSON value for the "End date" key to the nominative form "Дата окончания" so the
label reads correctly (locate the "End date" key in
src/frontend/public/locales/common/ru-RU.json and replace its value).

Comment on lines +493 to +494
"Split thread": "Разделить обсуждения",
"Split thread from here": "Разделить обсуждения с этого места",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Incorrect plural form for single-thread action.

"Split thread" refers to splitting a single thread, but the Russian translation uses plural "обсуждения" (threads). Should be singular "обсуждение" (thread) for grammatical consistency.

🔤 Suggested fix
-  "Split thread": "Разделить обсуждения",
-  "Split thread from here": "Разделить обсуждения с этого места",
+  "Split thread": "Разделить обсуждение",
+  "Split thread from here": "Разделить обсуждение с этого места",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Split thread": "Разделить обсуждения",
"Split thread from here": "Разделить обсуждения с этого места",
"Split thread": "Разделить обсуждение",
"Split thread from here": "Разделить обсуждение с этого места",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/public/locales/common/ru-RU.json` around lines 493 - 494, The
Russian translations for the keys "Split thread" and "Split thread from here"
use the plural "обсуждения" but should be singular; update the JSON values so
"Split thread" => "Разделить обсуждение" and "Split thread from here" =>
"Разделить обсуждение с этого места" to ensure correct grammatical number for
single-thread actions (edit the entries for the keys "Split thread" and "Split
thread from here" in src/frontend/public/locales/common/ru-RU.json).

"Start date": "Дата начала",
"Start date is required": "Необходимо ввести дату начала",
"Start date must be before end date": "Дата начала должна быть до даты завершения",
"Start day": "Дата начала",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

"Start day" translated identically to "Start date".

Both "Start day" (Line 501) and "Start date" (Line 498) translate to "Дата начала", making them indistinguishable. The Ukrainian locale correctly differentiates these as "День початку" vs "Дата початку". For consistency with the scheduling UI semantics, "Start day" should be "День начала".

🔤 Suggested fix
-  "Start day": "Дата начала",
+  "Start day": "День начала",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/public/locales/common/ru-RU.json` at line 501, The "Start day"
translation is identical to "Start date" and should be differentiated; update
the JSON entry with key "Start day" (currently "Дата начала") to the suggested
"День начала" so it matches the Ukrainian distinction and the scheduling UI
semantics.

"Forced signature": "Обов'язковий підпис",
"Forward": "Переслати",
"Forwarded message": "Переслане повідомлення",
"Friday": "П`ятниця",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typographical error: backtick instead of apostrophe in "Friday" translation.

The Ukrainian word for Friday should use a proper apostrophe (') character, not a backtick (`). This affects text rendering and may cause search/sort inconsistencies.

🔤 Suggested fix
-  "Friday": "П`ятниця",
+  "Friday": "П'ятниця",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Friday": "П`ятниця",
"Friday": "П'ятниця",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/public/locales/common/uk-UA.json` at line 287, The translation
value for the "Friday" key contains a backtick instead of an apostrophe; locate
the "Friday" JSON entry (currently "П`ятниця") and replace the backtick with a
proper apostrophe character so the value becomes "П'ятниця" to fix rendering and
search/sort issues.

Invalidate thread list when the user deletes its own
access to a thread to prevent buggy situation where the
user still display a thread that has no more access..
Update all version files and changelog for minor release.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/frontend/public/locales/common/nl-NL.json (1)

46-47: Pre-existing issue: Plural form uses singular noun.

Note: While not part of this PR's changes, the existing key at line 47 "{{count}} threads selected_other" incorrectly uses singular "thread" instead of plural "threads" in the Dutch translation. Both _one and _other forms have identical text, which defeats the purpose of pluralization.

Consider fixing in a follow-up:

-  "{{count}} threads selected_other": "{{count}} thread geselecteerd",
+  "{{count}} threads selected_other": "{{count}} threads geselecteerd",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/public/locales/common/nl-NL.json` around lines 46 - 47, The
Dutch pluralization for the key pair "{{count}} threads selected_one" and
"{{count}} threads selected_other" uses the singular "thread" for both forms;
update the "_other" form "{{count}} threads selected_other" to use the plural
"threads" (e.g., "threads" in Dutch: "threads" may be left or use "threads
geselecteerd" vs "thread" → change to "threads geselecteerd" or the correct
Dutch plural "threads geselecteerd"/"threads geselecteerd" as appropriate) so
the _one and _other forms correctly differ and reflect singular vs plural for
the keys "{{count}} threads selected_one" and "{{count}} threads
selected_other".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/frontend/public/locales/common/uk-UA.json`:
- Line 108: The Ukrainian translation for the JSON key "Are you sure you want to
delete this auto-reply? This action is irreversible!" uses the adverb
"безповоротно" but must use an adjective that agrees with the feminine noun
"дія"; change the ending to an adjective such as "незворотна" (e.g., "Ви дійсно
хочете видалити цей автовідповідач? Ця дія незворотна!") so the grammar agrees
with "дія" and matches other strings like "незворотна" in the file.

In
`@src/frontend/src/features/layouts/components/thread-view/components/thread-accesses-widget/index.tsx`:
- Line 31: The hook-level onSuccess passed into useThreadsAccessesDestroy (where
mutate is aliased to removeThreadAccess) causes duplicate invalidation; remove
the mutation:onSuccess option from the useThreadsAccessesDestroy call and
instead perform all cache invalidation inside the mutate-level onSuccess passed
to removeThreadAccess (the existing onSuccess that constructs the
{type:'delete', metadata:...} payload and calls invalidateThreadMessages()).
This consolidates invalidation for both self-removal and other removals and
prevents double-refetch.

---

Nitpick comments:
In `@src/frontend/public/locales/common/nl-NL.json`:
- Around line 46-47: The Dutch pluralization for the key pair "{{count}} threads
selected_one" and "{{count}} threads selected_other" uses the singular "thread"
for both forms; update the "_other" form "{{count}} threads selected_other" to
use the plural "threads" (e.g., "threads" in Dutch: "threads" may be left or use
"threads geselecteerd" vs "thread" → change to "threads geselecteerd" or the
correct Dutch plural "threads geselecteerd"/"threads geselecteerd" as
appropriate) so the _one and _other forms correctly differ and reflect singular
vs plural for the keys "{{count}} threads selected_one" and "{{count}} threads
selected_other".

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0faac56-7033-4359-b04e-6b482979e265

📥 Commits

Reviewing files that changed from the base of the PR and between 22402d0 and 0bdeb06.

⛔ Files ignored due to path filters (5)
  • src/backend/uv.lock is excluded by !**/*.lock
  • src/e2e/package-lock.json is excluded by !**/package-lock.json
  • src/frontend/package-lock.json is excluded by !**/package-lock.json
  • src/mta-in/uv.lock is excluded by !**/*.lock
  • src/mta-out/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • CHANGELOG.md
  • src/backend/pyproject.toml
  • src/e2e/package.json
  • src/frontend/package.json
  • src/frontend/public/locales/common/fr-FR.json
  • src/frontend/public/locales/common/nl-NL.json
  • src/frontend/public/locales/common/ru-RU.json
  • src/frontend/public/locales/common/uk-UA.json
  • src/frontend/src/features/layouts/components/thread-view/components/thread-accesses-widget/index.tsx
  • src/mta-in/pyproject.toml
  • src/mta-out/pyproject.toml
🚧 Files skipped from review as they are similar to previous changes (5)
  • src/frontend/package.json
  • CHANGELOG.md
  • src/frontend/public/locales/common/fr-FR.json
  • src/mta-in/pyproject.toml
  • src/mta-out/pyproject.toml

"Archive {{count}} threads_other": "Архівувати обговорення ({{count}})",
"Archives": "Архіви",
"Are you sure you want to close this dialog? Your upload will be aborted!": "Ви впевнені, що хочете закрити це діалогове вікно? Вивантаження буде перервано!",
"Are you sure you want to delete this auto-reply? This action is irreversible!": "Ви дійсно хочете видалити цей автовідповідач? Ця дія безповоротно!",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Grammatical error: adverb used instead of adjective.

The word "безповоротно" is an adverb, but the sentence requires an adjective to agree with the feminine noun "дія" (action). Compare with similar strings in the file (lines 110-114) that correctly use adjective forms like "незворотна" or "є незворотною".

🔤 Suggested fix
-  "Are you sure you want to delete this auto-reply? This action is irreversible!": "Ви дійсно хочете видалити цей автовідповідач? Ця дія безповоротно!",
+  "Are you sure you want to delete this auto-reply? This action is irreversible!": "Ви дійсно хочете видалити цей автовідповідач? Ця дія є безповоротною!",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Are you sure you want to delete this auto-reply? This action is irreversible!": "Ви дійсно хочете видалити цей автовідповідач? Ця дія безповоротно!",
"Are you sure you want to delete this auto-reply? This action is irreversible!": "Ви дійсно хочете видалити цей автовідповідач? Ця дія є безповоротною!",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/frontend/public/locales/common/uk-UA.json` at line 108, The Ukrainian
translation for the JSON key "Are you sure you want to delete this auto-reply?
This action is irreversible!" uses the adverb "безповоротно" but must use an
adjective that agrees with the feminine noun "дія"; change the ending to an
adjective such as "незворотна" (e.g., "Ви дійсно хочете видалити цей
автовідповідач? Ця дія незворотна!") so the grammar agrees with "дія" and
matches other strings like "незворотна" in the file.

const [searchQuery, setSearchQuery] = useState("");
const { selectedMailbox, selectedThread, invalidateThreadMessages } = useMailboxContext();
const { selectedMailbox, selectedThread, invalidateThreadMessages, invalidateThreadsStats, unselectThread } = useMailboxContext();
const { mutate: removeThreadAccess } = useThreadsAccessesDestroy({ mutation: { onSuccess: () => invalidateThreadMessages() } });
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Find generated destroy hook implementation =="
rg -n -C5 --type=ts 'useThreadsAccessesDestroy|useMutation|onSuccess' src/frontend/src/features/api/gen

echo
echo "== Find all call sites of useThreadsAccessesDestroy =="
rg -n -C3 --type=tsx '\buseThreadsAccessesDestroy\b' src/frontend/src

echo
echo "== Inspect this widget's invalidation calls =="
rg -n -C3 --type=tsx 'invalidateThreadMessages|removeThreadAccess' src/frontend/src/features/layouts/components/thread-view/components/thread-accesses-widget/index.tsx

Repository: suitenumerique/messages

Length of output: 50424


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Find thread-accesses-widget component =="
find . -name "*thread-accesses-widget*" -type f | head -20

echo
echo "== Inspect the component file around lines 31 and 100-103 =="
cat -n src/frontend/src/features/layouts/components/thread-view/components/thread-accesses-widget/index.tsx | sed -n '25,110p'

Repository: suitenumerique/messages

Length of output: 4523


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Find getThreadsAccessesDestroyMutationOptions implementation =="
rg -n -C 10 'getThreadsAccessesDestroyMutationOptions' src/frontend/src/features/api/gen/thread-access/thread-access.ts

echo
echo "== Find all call sites of useThreadsAccessesDestroy (excluding def) =="
rg -n 'useThreadsAccessesDestroy' src/frontend/src --type-list -g '!gen'

echo
echo "== Check how useMutation is called with options =="
rg -n -B5 -A5 'return useMutation' src/frontend/src/features/api/gen/thread-access/thread-access.ts | tail -20

Repository: suitenumerique/messages

Length of output: 1731


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Get full getThreadsAccessesDestroyMutationOptions implementation =="
rg -n -A 30 'export const getThreadsAccessesDestroyMutationOptions' src/frontend/src/features/api/gen/thread-access/thread-access.ts

echo
echo "== Find all useThreadsAccessesDestroy call sites =="
find src/frontend/src -name '*.tsx' -o -name '*.ts' | xargs grep -l 'useThreadsAccessesDestroy' | grep -v gen

Repository: suitenumerique/messages

Length of output: 1563


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Get COMPLETE getThreadsAccessesDestroyMutationOptions implementation =="
sed -n '737,800p' src/frontend/src/features/api/gen/thread-access/thread-access.ts

echo
echo "== Check React Query merge behavior by looking at similar hooks =="
grep -A 40 'export const getThreadsAccessesCreateMutationOptions' src/frontend/src/features/api/gen/thread-access/thread-access.ts | head -50

Repository: suitenumerique/messages

Length of output: 3538


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Check React Query documentation on callback merging behavior =="
# Let's check if there are any comments or test files showing how callbacks are merged
find src/frontend/src -name '*.test.*' -o -name '*.spec.*' | xargs grep -l 'onSuccess' 2>/dev/null | head -5

echo
echo "== Search for other similar patterns in the codebase =="
rg -n 'useThreadsAccesses.*{ mutation.*onSuccess' src/frontend/src --type tsx | head -10

echo
echo "== Check if invalidateThreadMessages can handle being called twice =="
rg -n -B3 -A15 'const invalidateThreadMessages' src/frontend/src

Repository: suitenumerique/messages

Length of output: 135


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Search for patterns of onSuccess at multiple levels =="
rg -n 'mutation.*onSuccess.*mutate.*onSuccess' src/frontend/src -U --multiline

echo
echo "== Check invalidateThreadMessages function definition =="
rg -n -B2 -A10 'invalidateThreadMessages.*=' src/frontend/src/features/layouts/components/thread-view

echo
echo "== Search for useMailboxContext to understand invalidation =="
rg -n -A40 'export.*useMailboxContext' src/frontend/src

Repository: suitenumerique/messages

Length of output: 124


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Find useMailboxContext definition =="
find src/frontend/src -name '*.tsx' -o -name '*.ts' | xargs grep -l 'useMailboxContext' | head -5

echo
echo "== Get the context file =="
find src/frontend/src -name '*mailbox*context*' -o -name '*MailboxContext*'

echo
echo "== Search for invalidateThreadMessages in context =="
rg -n 'invalidateThreadMessages' src/frontend/src/features/layouts/contexts

Repository: suitenumerique/messages

Length of output: 728


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Search for useMailboxContext definition =="
rg -n 'export.*useMailboxContext|export const useMailboxContext' src/frontend/src

echo
echo "== Find the actual mailbox context file =="
find src/frontend/src -type f \( -name '*.tsx' -o -name '*.ts' \) -exec grep -l 'export.*useMailboxContext' {} \;

echo
echo "== Look at the exact line in thread-accesses-widget import =="
head -30 src/frontend/src/features/layouts/components/thread-view/components/thread-accesses-widget/index.tsx | grep -E '^import|^export'

Repository: suitenumerique/messages

Length of output: 1104


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Find invalidateThreadMessages definition in mailbox context =="
rg -n -B5 -A10 'invalidateThreadMessages' src/frontend/src/features/providers/mailbox.tsx | head -50

echo
echo "== Check how React Query useMutation merges callbacks =="
# React Query composition behavior - checking if there are examples in tests
find src/frontend/src -type f -name '*.test.ts*' | xargs grep -l 'mutate.*onSuccess' 2>/dev/null | head -3

Repository: suitenumerique/messages

Length of output: 2455


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Get full invalidateThreadMessages implementation =="
rg -n -B2 -A25 'invalidateThreadMessages.*=' src/frontend/src/features/providers/mailbox.tsx | grep -A25 'invalidateThreadMessages.*='

echo
echo "== Check if there are multiple invalidations that could cause issues =="
rg -n 'invalidateThreadMessages' src/frontend/src/features/providers/mailbox.tsx

echo
echo "== Look at the exact invalidate call to understand parameters =="
sed -n '400,500p' src/frontend/src/features/providers/mailbox.tsx | grep -B3 -A10 'invalidate'

Repository: suitenumerique/messages

Length of output: 5722


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Check if createThreadAccess and updateThreadAccess have same pattern =="
rg -n 'useThreadsAccessesCreate|useThreadsAccessesUpdate' src/frontend/src/features/layouts/components/thread-view/components/thread-accesses-widget/index.tsx -B2 -A2

echo
echo "== Check if there are handlers for create and update with additional onSuccess =="
sed -n '52,76p' src/frontend/src/features/layouts/components/thread-view/components/thread-accesses-widget/index.tsx

Repository: suitenumerique/messages

Length of output: 2153


Consolidate thread access removal invalidation to avoid double-refetch on self-removal.

Both hook-level onSuccess (line 31) and mutate-level onSuccess (lines 94–107) fire when removeThreadAccess succeeds. On self-removal, this triggers invalidateThreadMessages() twice—once with no arguments and again with {type: 'delete', metadata: {...}}, causing redundant cache invalidation and potential UI flicker.

Remove the hook-level initialization and handle all invalidation in the mutate-level onSuccess callback:

Suggested fix
-    const { mutate: removeThreadAccess } = useThreadsAccessesDestroy({ mutation: { onSuccess: () => invalidateThreadMessages() } });
+    const { mutate: removeThreadAccess } = useThreadsAccessesDestroy();

Then consolidate invalidation logic in the onSuccess handler to cover both self-removal and other cases.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const { mutate: removeThreadAccess } = useThreadsAccessesDestroy({ mutation: { onSuccess: () => invalidateThreadMessages() } });
const { mutate: removeThreadAccess } = useThreadsAccessesDestroy();
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/frontend/src/features/layouts/components/thread-view/components/thread-accesses-widget/index.tsx`
at line 31, The hook-level onSuccess passed into useThreadsAccessesDestroy
(where mutate is aliased to removeThreadAccess) causes duplicate invalidation;
remove the mutation:onSuccess option from the useThreadsAccessesDestroy call and
instead perform all cache invalidation inside the mutate-level onSuccess passed
to removeThreadAccess (the existing onSuccess that constructs the
{type:'delete', metadata:...} payload and calls invalidateThreadMessages()).
This consolidates invalidation for both self-removal and other removals and
prevents double-refetch.

@jbpenrath jbpenrath merged commit 0bdeb06 into main Mar 16, 2026
14 checks passed
@jbpenrath jbpenrath deleted the release/0.5.0 branch March 16, 2026 17:57
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.

1 participant