Skip to content

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

Closed

Description

@CameronBrooks11

After a successful edit, push --apply reads back the text the wiki stored. If that read fails, core.Push still records the new revision, falls back to the text it sent, and puts the reason in PushResult.Detail:

pushed, but could not read back the saved text: <error>

cmdPush never prints Detail for a pushed page, so the warning is lost. Against a fake wiki whose edit succeeds and whose read-back returns internal_api_error, push --apply prints only:

logging in as Me@wikisync (from WIKISYNC_USERNAME_EXAMPLE)
pushed "Page" (now rev 2)

That leaves the baseline holding the text as sent rather than as stored, with no sign of it. The wiki may have normalised the text (it trims trailing whitespace, for one).

Fix: print the detail as a warning on stderr. The edit did land, so the exit code stays 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions