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

Fix for binary data representation when sending data through HTTP & MQTT #736

Merged

Conversation

KeshavSoni2511
Copy link
Contributor

Fix for issue #690

@KeshavSoni2511
Copy link
Contributor Author

Gentle Reminder!

@@ -127,7 +127,9 @@ function parseData(req, res, next) {
next(error);
} else {
req.jsonPayload = data;

if (req.body !== undefined || req.body === Object || Buffer.isBuffer(req.body)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you elaborate why is required this condition? (specially why using OR operator)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mapedraza , we require the condition because test case was failing in commands-Polling-test.js for undefind data.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failling even after restoring this line. Maybe you should restore this line too:

req.jsonPayload = req.jsonPayload.toString('hex');

Additionaly, could you explain why is failing and why is required? I do not understand why the 3 conditions are nested with OR operator.

Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mapedraza, I have run the test files on my local system and all the test case were running properly and passing. Here you can find in the screenshot.
Please guide me how can I fix it here?
Screenshot 2023-08-16 124608

Copy link
Contributor Author

@KeshavSoni2511 KeshavSoni2511 Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionaly, could you explain why is failing and why is required? I do not understand why the 3 conditions are nested with OR operator.

I have resolved it by latest changes , as per the requirements

@mapedraza
Copy link
Collaborator

Tests are failing. Maybe related with changes in bf45b6b?

@KeshavSoni2511
Copy link
Contributor Author

KeshavSoni2511 commented Aug 22, 2023

Tests are failing. Maybe related with changes in bf45b6b?

Hi @fgalan, @mapedraza, I have run the test files on my local system and all the test case were running properly and passing. Here you can find in the screenshot. Please guide me how can I fix it here.
fix690

@fgalan
Copy link
Member

fgalan commented Aug 22, 2023

Hi @fgalan, @mapedraza, I have run the test files on my local system and all the test case were running properly and passing. Here you can find in the screenshot. Please guide me how can I fix it here.

Results in GitHub are now the same as yours.

There is some test related with MQTT that sometimes "glitches" (due to some unknown timing issue). We have re-run in GitHub and now it is ok.

@KeshavSoni2511
Copy link
Contributor Author

Hi @fgalan , please let me know if any other change is required or PR can be merged.

@fgalan
Copy link
Member

fgalan commented Aug 24, 2023

Hi @fgalan , please let me know if any other change is required or PR can be merged.

Thanks for your contribution. We would provide a review with feedback and comments as soon as possible.

Copy link
Collaborator

@mapedraza mapedraza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mapedraza
Copy link
Collaborator

mapedraza commented Sep 26, 2023

@AlvaroVega It seems good for me. It does not break the tests. Can you have a quick look?

CHANGES_NEXT_RELEASE Outdated Show resolved Hide resolved
@mapedraza
Copy link
Collaborator

Before merging this PR, a twin PR should be created under https://github.com/telefonicaid/iotagent-ul/ fixing the same issue

Co-authored-by: Fermín Galán Márquez <fgalan@users.noreply.github.com>
@KeshavSoni2511
Copy link
Contributor Author

Before merging this PR, a twin PR should be created under https://github.com/telefonicaid/iotagent-ul/ fixing the same issue

Hi, same issue telefonicaid/iotagent-ul#601 was created and PR telefonicaid/iotagent-ul#603 was raised on iotagent-ul.
But as per comment received by @mapedraza telefonicaid/iotagent-ul#603 (comment) & @AlvaroVega #667 (comment) issue and PR was closed for iotagent-ul.

Do I need to raise PR on iotagent-ul? Please confirm.

@mapedraza
Copy link
Collaborator

mapedraza commented Sep 27, 2023

Do I need to raise PR on iotagent-ul? Please confirm.

@Keshav-NEC, you are right, no need to rise a new PR it for IoTA-UL (as you noted it was not necessary in previous PRs).

@mapedraza
Copy link
Collaborator

Before merging this PR to master, we would like to do some tests in advance, so this is going to be merged into a prelanding branch before merging to master.

@Keshav-NEC Thanks for your contribution.

@mapedraza mapedraza changed the base branch from master to prelanding/fix-binary-data October 3, 2023 09:41
@mapedraza mapedraza merged commit a79ee65 into telefonicaid:prelanding/fix-binary-data Oct 3, 2023
7 checks passed
@fgalan
Copy link
Member

fgalan commented Oct 3, 2023

Continuation PR #760

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.

4 participants