Announcement

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

    13.0 vs 12.1 Server Request ..getOldValues()

    SmartClient Version: v13.0p_2023-04-25/PowerEdition Deployment (built 2023-04-25)

    vs

    SmartClient Version: v12.1p_2021-10-22/PowerEdition Deployment (built 2021-10-22)


    I am seeing an exception in server side code on this line:

    Code:
    String summarySelectionGridID = (String) request.getOldValues().get("summarySelectionGridID");
    The null exception is on request.getOldValues(), as there are no 'OldValues' hash in the request.

    Leave aside for the moment that the code is badly formed, yes we should check if the request.getOldValues() is null first, but I wonder if you can confirm that the format of the request may have changed between 12.1 and 13.0. Certainly this code line has not changed in 5+ years on 6.x and 12.x.

    Here is the request packet on 13.0:

    Code:
    {
        dataSource:"BCG_Progress_Check_Details",
        operationType:"fetch",
        operationId:"fetchSynthesisSummaryStackStageNames",
        componentId:"isc_PickListMenu_0",
        startRow:0,
        textMatchStyle:"startsWith",
        resultSet:[ResultSet ID:isc_ResultSet_7 (dataSource: BCG_Progress_Check_Details, created by: isc_PickListMenu_0)],
        callback:{
            caller:[ResultSet ID:isc_ResultSet_7 (dataSource: BCG_Progress_Check_Details, created by: isc_PickListMenu_0)],
            methodName:"fetchRemoteDataReply"
        },
        willHandleError:true,
        showPrompt:false,
        prompt:"Finding Records that match your criteria...",
        requestId:"BCG_Progress_Check_Details$62763",
        internalClientContext:{
            requestIndex:1
        },
        fallbackToEval:false,
        componentContext:"SynthesisSummaryStackStageForm.SynthesisSummaryStackStageFilterSelect",
        lastClientEventThreadCode:"TMR1",
        bypassCache:true,
        dataProtocol:"getParams"
    }

    Here is the request packet from 12.1, notice that while the OldValues hash is empty the, the hash reference will not be null

    Code:
    {
        dataSource:"BCG_Progress_Check_Details",
        operationType:"fetch",
        operationId:"fetchSynthesisSummaryStackStageNames",
        componentId:"isc_PickListMenu_0",
        data:{
        },
        startRow:0,
        textMatchStyle:"startsWith",
        resultSet:[ResultSet ID:isc_ResultSet_0 (dataSource: BCG_Progress_Check_Details, created by: isc_PickListMenu_0)],
        callback:{
            caller:[ResultSet ID:isc_ResultSet_0 (dataSource: BCG_Progress_Check_Details, created by: isc_PickListMenu_0)],
            methodName:"fetchRemoteDataReply"
        },
        willHandleError:true,
        showPrompt:false,
        prompt:"Finding Records that match your criteria...",
      oldValues:{
        },
        requestId:"BCG_Progress_Check_Details$62730",
        internalClientContext:{
            requestIndex:1
        },
        fallbackToEval:false,
        componentContext:"SynthesisSummaryStackStageForm.SynthesisSummaryStackStageFilterSelect",
        lastClientEventThreadCode:"TMR3",
        bypassCache:true,
        dataProtocol:"getParams"
    }
    Is this difference ( presence / absence of OldValues) expected in 13.x?



    #2
    This particular result (oldValues being omitted rather than sent as an empty object) was not a specific task that was ever assigned - it came out of work on another task.

    However, it is something we want to keep: it's a tiny optimization, but more importantly, the client is now more correctly indicating the situation for the server: this request does not have a prior record that can be provided (oldValues). When previously an empty object was being sent, that was the client being inexact.

    So we'd recommend adding a null guard to your line of code there, although, if that's difficult somehow, you could always add your own empty oldValues object either client- or server-side, somewhere upstream of this code.

    Comment

    Working...
    X