Skip to content

fix(backend): tell users when and why a mind map was not saved - #461

Merged
AndyScherzinger merged 2 commits into
mainfrom
fix/backend-save-errors
Oct 27, 2026
Merged

AndyScherzinger merged 2 commits into
mainfrom
fix/backend-save-errors

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Two save errors now tell users what happened and what to do, and leave the technical details to the server log. Taken from the analysis of #259 (thanks @stephancordes for the diagnosis).

Situation Users saw Users now see Server log
Saving fails unexpectedly their own file path, a debugging leftover "The mind map could not be saved. Please try again later." the exception, with the file path
The save request lacks the modification time of the loaded file (user and public share controller) "The file you are working on was updated in the meantime…", although nobody else had changed it "The mind map could not be saved. Please reload it and try again." (reloading fetches a fresh modification time) the request, with the file path

Also cleaned up while there: the branch originally meant for the missing modification time could never be reached and is removed, and the save endpoint no longer logs under files_texteditor.

The two messages are new strings and go through Transifex as usual.

Not included from #259: normalizing $dir . '/' . $filename in load(). Folder::get() already collapses duplicate slashes (PathHelper::normalizePath()), so //file.km resolves fine.

The repo has no PHP test setup, so this is checked with php -l. Manual checks to do on an instance: save normally; save with a tampered mtime (expect the "updated in the meantime" message); save with the mtime removed from the request (expect the reload message and a log entry); the same on a public share with edit rights.

The 0.1.x backport is #462; the controllers are identical there.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

@AndyScherzinger AndyScherzinger added this to the v0.2.0 milestone Oct 27, 2026
@AndyScherzinger AndyScherzinger added bug Something isn't working AI assisted This PR contains AI-assisted commits 3. to review php labels Oct 27, 2026
When saving a mind map threw an unexpected exception, the response
showed the file's path as the error, a leftover from debugging. Users
now read that the mind map could not be saved and should try again
later, and the exception is logged, so admins can find out what went
wrong.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
A save request without the modification time of the loaded file was
compared against the file's mtime and failed with "The file you are
working on was updated in the meantime", which sent users looking for
a conflict that did not exist. Both the user and the public share
controller now tell users that the mind map could not be saved and to
reload it, which fetches a fresh modification time, and log the request
for admins. The branch that was meant to handle this could never be
reached and is gone, and log entries from the save endpoint are no
longer attributed to files_texteditor.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger
AndyScherzinger force-pushed the fix/backend-save-errors branch from 77496fb to 5a793cf Compare October 27, 2026 16:43
@AndyScherzinger AndyScherzinger changed the title fix(backend): proper error messages when saving fails fix(backend): tell users when and why a mind map was not saved Oct 27, 2026
@AndyScherzinger
AndyScherzinger merged commit db6e24e into main Oct 27, 2026
8 checks passed
@AndyScherzinger
AndyScherzinger deleted the fix/backend-save-errors branch October 27, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review AI assisted This PR contains AI-assisted commits bug Something isn't working php

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant