Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    performCustomOperation and relatedUpdates

    SmartClient Version: SNAPSHOT_v13.1d_2024-03-22/Enterprise Deployment (built 2024-03-22)

    Chrome on MacOS

    Hello, I'm trying performCustomOperation to call a DMI, where I return a DSResponse which is constructed as:

    Code:
    ...
            DSResponse dsResponse = new DSResponse(dataSource);
            dsResponse.addRelatedUpdate(removeTheUser(email));
            for (DSResponse relatedUpdate : relatedUpdates) {
                dsResponse.addRelatedUpdate(relatedUpdate);
            }
    ...
    what I see in the response is a bit strange:

    Code:
    {
        affectedRows:0,
        invalidateCache:false,
        isDSResponse:true,
        operationType:"custom",
        queueStatus:0,
        relatedUpdates:[
            {
                data:[
                    {
                        EMAIL:"test_1@foo.bar"
                    }
                ],
                invalidateCache:false,
                isDSResponse:true,
                queueStatus:0,
                affectedRows:1,
                operationType:"remove",
                dataSource:"AUTH_USERS_ROLES_PERMISSIONS",
                status:0
            },
            {
                invalidateCache:false,
                relatedUpdates:[
                    {
                        data:[
                            {
                                ID_REC:33052
                            }
                        ],
                        invalidateCache:false,
                        isDSResponse:true,
                        affectedRows:1,
                        operationType:"remove",
                        dataSource:"AUTH_USERS_PERMISSIONS_EXT",
                        status:0
                    },
    ....
    as you may see, there's the first relatedUpdate in the dsResponse.relatedUpdates array (and it seems to update the cache nicely), then the others are in another array, dsResponse.relatedUpdates[1].relatedUpdates

    is it a bug, or am I missing something?

    #2
    This is what you would expect to see if you called addRelatedUpdate() on a DSResponse that was itself added to another DSResponse as a relatedUpdate. Something in your code is likely doing this - it's not shown in the snippet above, but could be in a helper method or similar.

    Comment


      #3
      What can I say? You're right... I found the guilty code. Sorry for the bogus report.

      Comment


        #4
        No problem :)

        Comment

        Working...
        X