tahoe-lafs / magic-folder

Tahoe-LAFS-based file synchronization
Other
25 stars 7 forks source link

Successfully cancelled invites are displayed as folder "errors" #707

Closed crwood closed 1 year ago

crwood commented 1 year ago

After successfully cancelling a pending magic-folder invite (via POST /experimental/magic-folder/FOLDER_NAME/invite-cancel), the magic-folder "status" API immediately emits an "errors" message, like so:

{
    "state": {
        "synchronizing": False,
        "folders": {
            "Cat Pics": {
                "uploads": [],
                "downloads": [],
                "errors": [
                    {
                        "timestamp": 1678906261,
                        "summary": "Invite of 'test' failed: ",
                    }
                ],
                "recent": [
                    {
                        "relpath": "Garfield.jpg",
                        "modified": 1678893964,
                        "last-updated": 1678893966,
                        "conflicted": False,
                    },
                ],
                "tahoe": {"happy": True, "connected": 1, "desired": 1},
                "scanner": {"last-scan": 1678906210.1789653},
                "poller": {"last-poll": 1678906210.6793106},
            }
        },
    }
}

This "error" appears to occur regardless of whether anything was awaiting on the .../invite-wait endpoint.

Because the cancellation, in this case, was both a) initiated by the end user and b) completed successfully, I would not expect this to be represented as an "error". If cancelled invites are supposed to be represented as "errors", however, consider specifying the accompanying reason in the message "summary" field (for example, as "Invite of 'test' failed: _cancelled by user_" instead of just "Invite of 'test' failed: ").

crwood commented 1 year ago

Closing in favor of #706; @meejah beat me to it! :)