Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BFW-6065] [BUG] /api/v1/job GET response contains invalid JSON #4193

Open
ysmilda opened this issue Sep 9, 2024 · 2 comments · Fixed by #4196
Open

[BFW-6065] [BUG] /api/v1/job GET response contains invalid JSON #4193

ysmilda opened this issue Sep 9, 2024 · 2 comments · Fixed by #4196
Assignees
Labels
bug Something isn't working. scheduled We are working on it or we have scheduled it for one of the next releases.

Comments

@ysmilda
Copy link
Contributor

ysmilda commented Sep 9, 2024

Printer model

Mini+

Firmware version

>= v5.0.0-alpha3

Upgrades and modifications

No response

Printing from...

PrusaLink

Describe the bug

When a job is present without stat the returned JSON response for a GET request to /api/v1/job is invalid. It contains a comma at the end of the object which should only be there if the message has stat.

JSON_FIELD_STR("path", sfn_path) JSON_COMMA;
if (has_stat) {
JSON_FIELD_INT_G(has_stat, "size", st.st_size) JSON_COMMA;
JSON_FIELD_INT_G(has_stat, "m_timestamp", st.st_mtime);
}

Moving the JSON_COMMA macro from the end of line 434 to the start of line 436 should fix the message.

How to reproduce

No response

Expected behavior

No response

Files

No response

@ysmilda ysmilda added the bug Something isn't working. label Sep 9, 2024
@danopernis danopernis self-assigned this Sep 16, 2024
@danopernis
Copy link
Member

Hello, thanks for the bug report and thanks for the pull request. This is indeed a bug, I am opening internal ticket to track it.

@danopernis danopernis added the known issue Our developers are aware of the issue. They will work on it. label Sep 16, 2024
@danopernis danopernis changed the title [BUG] /api/v1/job GET response contains invalid JSON [BFW-6065] [BUG] /api/v1/job GET response contains invalid JSON Sep 16, 2024
@danopernis danopernis reopened this Sep 16, 2024
@danopernis danopernis added scheduled We are working on it or we have scheduled it for one of the next releases. and removed known issue Our developers are aware of the issue. They will work on it. labels Sep 16, 2024
@danopernis
Copy link
Member

Thanks for the contribution, this is scheduled for next 6.2.0 version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. scheduled We are working on it or we have scheduled it for one of the next releases.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants