Skip to content

fix(cli): print push's warning when the saved text can't be read back - #62

Merged
CameronBrooks11 merged 1 commit into
mainfrom
fix/push-readback-warning
Nov 13, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
fix/push-readback-warning

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

After an edit lands, push --apply reads back the text the wiki stored. If that read fails, core.Push keeps the new revision, falls back to the text it sent, and records why in PushResult.Detail. cmdPush never printed Detail for a pushed page, so that warning was lost.

It now prints on stderr:

warning "Page": pushed, but could not read back the saved text: mediawiki api error internal_api_error: Database error

The exit code stays 0, since the edit landed.

TestPushWarnsWhenTheSavedTextIsUnreadable drives push --apply against a fake wiki whose read-back fails. It fails without the fix: stderr has only the login line. docs/commands.md and the changelog mention the warning.

Closes #58

When an edit landed but reading back the stored text failed, core.Push
kept the new revision, fell back to the text it sent, and put the
reason in PushResult.Detail. cmdPush never printed Detail for a pushed
page, so the warning was lost. It now goes to stderr as a warning
line; the exit code stays 0, since the edit landed.

TestPushWarnsWhenTheSavedTextIsUnreadable fails without the fix.

Closes #58
@CameronBrooks11
CameronBrooks11 merged commit a066f68 into main Nov 13, 2026
11 checks passed
@CameronBrooks11
CameronBrooks11 deleted the fix/push-readback-warning branch November 13, 2026 17:32
CameronBrooks11 added a commit that referenced this pull request Nov 13, 2026
Prepares v0.5.1: the version constant becomes 0.5.1, and the CHANGELOG's
Unreleased section becomes 0.5.1. User-facing changes since v0.5.0: #52
(HTTP status on login and edit errors, #45), #53 (conflict check reads
the revision id only, #46), #61 (login failure and count wording, #56),
#62 (push read-back warning, #58). The rest are refactors with no change
in behaviour: #54, #55, #57, #59, #60. The tag is pushed after this
merges.
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.

push: the warning for an unreadable saved text is never printed

1 participant