Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006535opensim[REGION] Script Functionspublic2013-02-07 17:142014-07-29 13:42
Reporterjustincc 
Assigned Tocmickeyb 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Versionmaster (dev code) 
Target Versionmaster (dev code)Fixed in Version 
Summary0006535: JsonReadNotecard() does not work as expected for non-root paths
DescriptionIf JsonReadNotecard() is given a non-root multi-component path (e.g. foo.bar) which does not already exist, the contents are not loaded into the store.

However, if a single component path (e.g. foo) is given which does not already exist, the contents are loaded to this location (e.g. foo.Hello). This does not work for multi-component paths where all components except the last one exist.

In addition, if an invalid path of "/" is given for the read, the contents are still loaded into the store at its root.

Are any/all of these behaviours expected?
Steps To ReproduceThis script will reproduce the all new multi-component path behaviour.

key storeID;
key requestID;

default
{
    touch_start(integer n)
    {
        storeID = JsonCreateStore("{}");
        requestID = JsonReadNotecard(storeID, "foo.bar", "nc1");
    }

    link_message(integer sender, integer ival, string sval, key id)
    {
        integer res = JsonTestPath(storeID, "Hello");
        llOwnerSay("Result for Hello " + (string)res);
        
        integer res2 = JsonTestPath(storeID, "foo.bar.Hello");
        llOwnerSay("Result for foo.bar.Hello " + (string)res2);
    }
}

with the notecard "nc1" containing

{"Hello":"World"}
TagsNo tags attached.
Git Revision or version number528f23beab703e60ec522117a2a442e733565727
Run Mode Grid (1 Region per Sim)
Physics EngineODE
EnvironmentMono / Linux64
Mono Version2.10
ViewerLL 3.3.4
Attached Files

- Relationships

-  Notes
(0023539)
cmickeyb (administrator)
2013-02-08 09:45

This is the expected behavior. The JsonStore does not "fill in" paths. You're expecting the "foo" hash to exist in order to place "bar". So try this:

        storeID = JsonCreateStore("{'foo' : {}}");
        requestID = JsonReadNotecard(storeID, "foo.bar", "nc1");
(0023545)
justincc (administrator)
2013-02-08 18:11

Thanks for the clarification, Mic. Going to leave this open for now for the issue with the invalid path (in this case "/").
(0023558)
cmickeyb (administrator)
2013-02-09 14:25

Fixed the path handling last night. Check it out & let me know if its still breaks for you.

- Issue History
Date Modified Username Field Change
2013-02-07 17:14 justincc New Issue
2013-02-07 18:31 justincc Description Updated View Revisions
2013-02-07 18:31 justincc Steps to Reproduce Updated View Revisions
2013-02-07 18:44 justincc Description Updated View Revisions
2013-02-07 18:44 justincc Steps to Reproduce Updated View Revisions
2013-02-08 09:32 cmickeyb Assigned To => cmickeyb
2013-02-08 09:32 cmickeyb Status new => assigned
2013-02-08 09:45 cmickeyb Note Added: 0023539
2013-02-08 18:11 justincc Note Added: 0023545
2013-02-09 14:25 cmickeyb Note Added: 0023558
2013-02-11 20:02 cmickeyb Status assigned => resolved
2013-02-11 20:02 cmickeyb Resolution open => fixed
2014-07-29 13:42 chi11ken Status resolved => closed


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker