X Tutup
Skip to content

fix: resolve exception when action ID is passed to printer formatter#61

Merged
nats merged 2 commits intobinarylane:mainfrom
nats:fix/int-printer
Mar 5, 2025
Merged

fix: resolve exception when action ID is passed to printer formatter#61
nats merged 2 commits intobinarylane:mainfrom
nats:fix/int-printer

Conversation

@nats
Copy link
Copy Markdown
Contributor

@nats nats commented Feb 28, 2025

When --async is used in combination with ActionLinkRunner, the response passed to printer is the action ID as a bare int. This PR updates formatter.format_response() to correctly handle this case.

JsonPrinter had a similar issue which I have also resolved.

@nats
Copy link
Copy Markdown
Contributor Author

nats commented Feb 28, 2025

@david-pershouse when --async is not used with ActionLinkRunner, the progress of the action is shown on stderr. On completion the initial data included with the ActionLink response (e.g. a "server" object when creating a server) is passed to the printer.

When --async is used with ActionLinkRunner, the action ID is passed to printer; and then the data included with the ActionLink response is also passed to the printer. This results in two printouts; which looks kinda weird - especially so when --output json.

Maybe we should not output the data included with ActionLink response when --async is used? If we made that change in this PR it would not be a beaking change, since currently the exception raised on printing the action ID prevents the second printout from occurring.

@david-pershouse
Copy link
Copy Markdown
Contributor

david-pershouse commented Mar 5, 2025

Maybe we should not output the data included with ActionLink response when --async is used?

this makes sense to me, if the user wants to track the action themselves etc, a single output of just the action is probably most useful and less confusing

@nats nats force-pushed the fix/int-printer branch 5 times, most recently from 06a2969 to 856ea6f Compare March 5, 2025 06:41
@nats nats force-pushed the fix/int-printer branch from 856ea6f to 935e9f4 Compare March 5, 2025 07:17
@nats nats merged commit 8cde3ab into binarylane:main Mar 5, 2025
18 checks passed
@nats nats deleted the fix/int-printer branch March 5, 2025 07:20
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.

2 participants

X Tutup