iotagent-node-lib icon indicating copy to clipboard operation
iotagent-node-lib copied to clipboard

explicitAttrs: "true" is not true

Open mrutid opened this issue 3 years ago • 2 comments

explicitAttrs: true behaves as expected

but

explicitAttrs:"true" or explicitAttrs:"m0==null?[]:true" doesn't.

mrutid avatar Sep 02 '22 12:09 mrutid

Hi @mrutid and @fgalan , could you please provide me the detailed description regarding the issue? also, could you attach the specific link or data to reproduce this issue. Thank you.

MayankSingh-NEC avatar Sep 12 '22 06:09 MayankSingh-NEC

Hi @MayankSingh-NEC, thanks for your willingness to contribute to the IoT Agent. Somehow this is a corner case, so this is nor urgent. It would be addressed later when refactoring the code related in the iotagent-node-lib.

mapedraza avatar Sep 13 '22 09:09 mapedraza

Hi @mrutid and @fgalan , I'm not able to reproduce this issue. As, it is completely working fine in my system, using the default configs. PFA.

  1. Group Provisioning
curl -iX POST \
  'http://localhost:4041/iot/services' \
  -H 'Content-Type: application/json' \
  -H 'fiware-service: myHome' \
  -H 'fiware-servicepath: /environment' \
  -d '{
 "services": [
   {
     "apikey":      "4jggokgpepnvsb2uv4s40d59ov",
     "cbHost":     "http://orion:1026",
     "entity_type": "Device",
     "resource":    "/iot/d",
	 "explicitAttrs": "m0==null?[]:true" or "true"
    }
 ]
}'

Note: Response can be seen in the iotagent-json logs. Attached in the file. 1 2

MayankSingh-NEC avatar Nov 15 '22 06:11 MayankSingh-NEC

Thank @MayankSingh-NEC for testing the issue. You are just checking the group provision. This was working well.

The problem behind this is how the agent is working when sending the measures. You should test If sending a measure m0, then the measures should not be propagated to the CB. Everything else should be persisted.

Having said that, this problem was already analysed and identified. The challenge here is the logic is distributed across the codebase, so it is not a simple fix. We are waiting until refactoring the code related with explicitAttrs, that would simplify the fix.

mapedraza avatar Nov 15 '22 11:11 mapedraza

This issue is fixed by https://github.com/telefonicaid/iotagent-node-lib/pull/1314

AlvaroVega avatar Mar 27 '23 07:03 AlvaroVega

@MayankSingh-NEC could you check again (using master branch) and provide feedback, please? Thanks!

fgalan avatar Mar 27 '23 07:03 fgalan

@MayankSingh-NEC could you check again (using master branch) and provide feedback, please? Thanks!

Hi @fgalan , I've tested and verified that now, it's working fine. Thanks :))

MayankSingh-NEC avatar Apr 18 '23 11:04 MayankSingh-NEC

@MayankSingh-NEC thanks for the report!

We close the issue, based on your positive feedback.

fgalan avatar Apr 19 '23 17:04 fgalan