mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1452] [Issue]: Long-Term Memory: settings forms refill from the cache when the reload after Reset or Import fails #738
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#738
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1452
Originally assigned to: @Promansis on GitHub.
Summary
After Reset settings or Import backup, the settings forms are cleared and refilled from the next fetch. If that fetch fails, the forms refill from the cached pre-reset (or pre-import) values instead, with no error shown. The screen then shows settings the server no longer has, and a Save would write them back. (Tracker item UI-4; a known edge left by #1376's CodeRabbit repair.)
Affected package
long-term-memory1.4.48 (upstream/staging1f7954305).C=packages/long-term-memory/src/engine/packages/client/src/features/long-term-memoryExpected behavior
After Reset or Import, the forms show only settings fetched after the action. If that fetch fails, the forms show the error surface with a retry, not the old values.
Actual behavior
MaintenancePanel.resetSettings(C/settings/MaintenancePanel.tsx:418-462) callssettings.clear(), awaits the invalidation, then applies the refetched settings or callssettings.clear()again when the refetch did not complete (:441-446). The comment at:441-442records the refill.settings.clear()(C/settings/MemorySettings.tsx:344-349) sets the four form states tonull.MemorySettings.tsx:240-251) run whenever a form isnullandglobal.dataorextraction.dataexists. React Query keeps the previous data in the cache when a refetch fails, so the effects refill the forms from it.MaintenancePanel.tsx:391-412) has the same shape:settings.clear()at:403, then the effects refill from the previous vault's settings.Checked at
1f7954305.Steps to reproduce
GET /api/long-term-memory/settingsin dev tools), then press Reset settings and confirm.Minimal fix
One PR, patch bump.
C/settings/MemorySettings.tsxandC/settings/MaintenancePanel.tsxonly.clearrecord when the forms were cleared, for example aformsClearedAtstate set toDate.now(), and make the two populate effects (:240-251) populate only when the query'sdataUpdatedAtis at or after it.useQueryexposesdataUpdatedAt. Stale cached data then never refills a cleared form.MaintenancePanelno longer needs the secondsettings.clear()at:446or the comment at:441-442; keepapplyfor the success path so the forms load without waiting for a render. Leave the backup import's integrity check (:402-405) as it is.nulland the query is in error,MemorySettingsalready renders its error surface with a retry (the<section>root is kept so the Maintenance panel stays mounted,:359-362); confirm the retry path repopulates once a fetch succeeds.CHANGELOG under
## Unreleased: one bullet, that a failed reload after Reset or Import now shows an error instead of the old settings.Not included
.refetch()calls and thequeryKeys.rootinvalidation noted in the client UI audit (A-012). Different behaviour, separate change.Regression proof
tests/long-term-memory-browser.regression.ts: extend the #1376 Reset case (:3704onward, which already routes/settings/resetand gates the settings read). Add a variant where the settings refetch after Reset fails once: the form does not show the pre-reset value, the error surface is shown, and a retry loads the reset value. Mirror it for Import backup if the fixture allows; otherwise state that Import shares the code path.feedback-clarity-ui.Environment
staging2039583ca)upstream/staging1f7954305)Logs, screenshots, or video
None. Recorded as a known edge in the #1376 repair notes and confirmed by reading the code at
1f7954305.Additional context
Tracker item UI-4. Follow-up to #1376 (PR #1400). Shares no source file with the other batch-1 issues; it is the only one that edits the browser regression.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: