SlideRuleEarth / sliderule

Server and client framework for on-demand science data processing in the cloud
https://slideruleearth.io
Other
25 stars 11 forks source link

LuaLibraryMsg::lmsg_getfieldvalue() does not handle array indexing correctly, the first element is always returned #409

Open elidwa opened 1 month ago

elidwa commented 1 month ago

LuaLibraryMsg::lmsg_getfieldvalue() is designed to work with arrays. However, when running the test atl03_viewer.lua, I observed that regardless of the index value provided for the array, the function always returns the first element. I verified that the array is populated with different segment_id values for elements in the array.

This can be demonstrated using the atl03_viewer.lua test script:

print("segment 0", extentrec:getvalue("segments[0].segment_id")) print("segment 10", extentrec:getvalue("segments[10].segment_id")) print("segment 100", extentrec:getvalue("segments[100].segment_id"))

The output is as follows:

segment 0 555764.0 segment 10 555764.0 segment 100 555764.0