Announcement

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

    too much recursion error on ValuesManager.editRecord() with 6/8 nightly

    Hi there,

    We are seeing an error calling ValuesManager.editRecord() that wasn't occurring with the 4/5 nightly we've been using but is now happening with the 6/8 nightly. We are seeing the problem with Firefox, Chrome, and IE.

    It looks like it is happening in the call to setData() inside the 39m function. Here is the output. We have a very large record we pass in and that may be the problem?

    Code:
    calling setData with 
    _1={aggregateFundAssetID: 4372,
    aggregateFundAssetJSON: null,
    aggregateTicker: "ORCL",
    aggregated: null,
    alternateStatusID: null,
    assetID: 4178,
    assetJSON: Obj,
    benchmarkWeight: null,
    costBasis: null,
    created: Date(1/3/11),
    createdUserName: "Guthridge, Bill",
    currentIntegrationShares: 0,
    currentShares: 11,
    customFieldInstanceListJSON: Array[3],
    deleted: false,
    departmentID: null,
    exchangeID: 7,
    fixedOPS: null,
    fixedOPSToCPSFlag: false,
    fundAssetID: 4373,
    fundAssetSectorListJSON: null,
    fundAssetTradeHistoryListJSON: null,
    fundID: 14,
    fundJSON: Obj{name:Zeta Fund},
    fundName: "Zeta Fund",
    fundVersion: 130,
    gridFundAsset: true,
    historicalDate: null,
    maxPositionReason: null,
    maxPositionSize: null,
    modified: Date(1/3/11),
    modifiedUserName: "Guthridge, Bill",
    relativeIndexPriceDate: null,
    relativeIndexPriceHistorical: null,
    shareBias: null,
    sharesPurchasedCost: null,
    sharesSoldCost: null,
    statusID: 1,
    subordinate: null,
    subordinateFundAssetListJSON: Array[0],
    ticker: "ORCLA221132.00",
    tradesModified: Date(1/3/11),
    underlyingAssetID: 4179,
    version: 1,
    viewUserID: 30,
    washRuleDate: null,
    aggregateFundAsset: Obj,
    fundAssetCalculationsComplete: true,
    analysisConfidenceID: 100,
    analystID: 30,
    ask: null,
    assetAvgDailyVol: null,
    assetAvgDailyVol_AT: null,
    assetBeta: null,
    assetErAdjustment: null,
    assetErAdjustmentReason: null,
    assetExchangeRate: 1,
    assetIdeaSource: null,
    assetName: null,
    assetNotesListJSON: Array[0],
    assetNotesShort: null,
    assetScenarioListJSONAll: Array[0],
    associateID: null,
    bid: null,
    bloombergTicker: null,
    calculatedDelta: null,
    companyID: null,
    correlation: null,
    currencyCode: null,
    currentPrice: null,
    cusip: null,
    delta: null,
    departmentAssetCounter: null,
    exchange: null,
    exchangeAccess: null,
    exchangeIDOverride: null,
    exchangePermissionCode: "d",
    expirationDate: null,
    fiftyTwoWeekHigh: null,
    fiftyTwoWeekLow: null,
    firstLSUpdateReceivedRecord: true,
    fixedAssetAvgDailyVol: null,
    fixedAssetBeta: null,
    fixedAssetExchangeRate: null,
    fixedAssetFlag: false,
    fixedAssetName: null,
    fixedAssetOptionDelta: null,
    fixedAssetPrice: null,
    fixedAssetUnderSymbol: null,
    fixedUnderlyingAssetPrice: null,
    gicsIndustry: null,
    gicsIndustryGroup: null,
    gicsSector: null,
    impliedDelta: null,
    impliedVolatility: null,
    initialServerRequestDateTime: "6/9/11 2:46 AM",
    lsTimeLastTrade: null,
    pctChangeDay: null,
    price12Week: null,
    price1Week: null,
    price4Week: null,
    price52Week: null,
    priceCurrentYearBegin: null,
    scenariosModified: null,
    scenariosModifiedPrice: null,
    securityTypeID: 28,
    strikePrice: null,
    timeLastTrade: null,
    traderID: null,
    underBloombergTicker: null,
    underCurrencyCode: null,
    underCusip: null,
    underlyingAssetName: null,
    undersymbol: "ORCLA221132.00",
    undersymbolBeta: null,
    undersymbolCurrentPrice: 31.54,
    useAutoScenarios: 0,
    valueChangeDay: null,
    volatility: null,
    volume: null,
    yield: null,
    psTicker: "ORCLA221132.00;null;null;null;null;A.OTC",
    assetScenarioListJSON_autoGeneratedAT: Array[0],
    assetScenarioListJSON: Array[0],
    customFieldAT-Competitive Advantage: null,
    customFieldAT-Hedge: null,
    customFieldAT-Rank: "1",
    tradeHistoryIntegrationActive: false,
    avgVolumeValue: null,
    optionDeltaAdjustedExposure: 0,
    absOptionDeltaAdjustedExposure: 0,
    optionBetaDeltaAdjustedExposure: 0,
    absOptionBetaDeltaAdjustedExposure: 0,
    currentPosition: 0,
    currentPositionAbs: 0,
    betaAdjCurrentPosition: 0,
    absBetaAdjCurrentPosition: 0,
    currentPositionValue: 0,
    deltaAdjustedCurrentPositionValue: 0,
    longShortIndicator: "NA",
    relativeIndexPrice: null,
    relativeIndexPricePctChange: null,
    relativeIndexCurrencyCode: null,
    scenariosModifiedPctChange: null,
    scenariosProbabilityTotal: 0,
    expectedReturn: null,
    preIndexAdjustExpectedReturn: null,
    compareER: 0,
    expectedValue: null,
    optimalPosition: 0,
    preConstraintOptimalPosition: 0,
    absOptimalPosition: 0,
    absAbsOptimalPosition: 0,
    optimalPositionAbs: 0,
    pctCurrentFromOptimal: 0,
    pctBetaAdjCurrentFromOptimal: 0,
    sharesToTrade: 0,
    tradeAlertIndicator: null,
    optimalShares: 0,
    optionDeltaAdjustedOptimalExposure: 0,
    absOptionDeltaAdjustedOptimalExposure: 0,
    optPctChangeContr: undef,
    assetDownSideRisk: -100,
    assetFundDownSideRisk: 0,
    assetabsOptimalDownSideRisk: null,
    assetFundAbsOptimalDownSideRisk: null,
    optimalPositionValue: 0,
    valueToTrade: 0,
    scenariosProbabilityTotal_autoGeneratedAT: 0,
    expectedReturn_autoGeneratedAT: null,
    preIndexAdjustExpectedReturn_autoGeneratedAT: null,
    compareER_autoGeneratedAT: 0,
    expectedValue_autoGeneratedAT: null,
    optimalPosition_autoGeneratedAT: 0,
    preConstraintOptimalPosition_autoGeneratedAT: 0,
    absOptimalPosition_autoGeneratedAT: 0,
    absAbsOptimalPosition_autoGeneratedAT: 0,
    optimalPositionAbs_autoGeneratedAT: 0,
    pctCurrentFromOptimal_autoGeneratedAT: 0,
    pctBetaAdjCurrentFromOptimal_autoGeneratedAT: 0,
    sharesToTrade_autoGeneratedAT: 0,
    tradeAlertIndicator_autoGeneratedAT: null,
    optimalShares_autoGeneratedAT: 0,
    optionDeltaAdjustedOptimalExposure_autoGeneratedAT: 0,
    absOptionDeltaAdjustedOptimalExposure_autoGeneratedAT: 0,
    optPctChangeContr_autoGeneratedAT: undef,
    assetabsOptimalDownSideRisk_autoGeneratedAT: null,
    assetFundAbsOptimalDownSideRisk_autoGeneratedAT: null,
    optimalPositionValue_autoGeneratedAT: 0,
    valueToTrade_autoGeneratedAT: 0,
    totalGainLoss: null,
    pctChange: undef,
    pctChangeContr: undef,
    pctFundGainLoss: null,
    pctFundGainLossIndicator: false,
    pctFundChangeLossIndicator: false,
    assetID-fundAssetID: "4178-4373",
    atOldValues: Obj,
    newPriceFlag: false,
    parentRecord: Obj{name:Zeta Fund},
    scenarioCalculationsComplete: true,
    autoScenarioCalculationsComplete: true,
    newFundVersion: null,
    oldTicker: null,
    oldExchangeID: null}
    11:13:06.816:TMR0:WARN:Log:InternalError: too much recursion
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
    
    ....THIS GOES ON FOR A LONG TIME..TRUNCATING..
    
    
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues([object Array], [object Array], null, undef)
        ValuesManager._cloneValues({Obj}, {Obj}, null, undef)
        ValuesManager._cloneValues({Obj}, {Obj})
        ValuesManager.setValues(_1=>{Obj})
        ValuesManager.setData(_1=>{Obj})
        unnamed({Obj})
        unnamed({Obj})
        updateFormEditModeCustomizationTab({Obj}, true, true) @ js/at_js_static.js?build=local_dev:2198
        updateDetailFormsBody(true, true) @ js/at_js_static.js?build=local_dev:2188
        anonymous()
        [c]Class.fireCallback(_1=>"updateDetailFormsBody(true,true);clearA..."[ 51],  _2=>undef,  _3=>[object Array],  _4=>[object Proxy],  _5=>true)
        Timer._fireTimeout("$ir215")
        unnamed()
        unnamed() @

    #2
    That looks like runaway recursion, not just a large record. Do you have looping data structures within the record? That would probably cause this.

    Comment


      #3
      I'm not sure what you mean by looping data structures. What sort of output could I produce that would let us inspect the record more closely? The output I provided in my original post is from an calling echoAll() on the record.

      Comment


        #4
        We meant looping as in A points to B and B back to A.

        Comment


          #5
          I guess it is possible. Did something change in between your 4/5 nightly and your 6/8 nightly that would make those sort of references go into a recursion loop like this? This has never happened before evaluating this nightly and the structure of these records has not significantly changed in a long time.

          Comment


            #6
            Please try this again and output the record using isc.echoFull() rather than isc.echoAll(). There are a few fields in your output with values that are arrays or objects - echoFull() will output those in full and probably show what the issue is. If not, please post the updated record.

            Comment


              #7
              Hi,

              I tried echoFull and it kept crashing my browser. That was presumably for the same reason we are seeing this recursion error. So, I went over the potential problematic attributes on this record and found the attribute causing problems.

              We do have an attribute called fundJSON which is a reference to a record of another Datasource. And, fundJSON has a list attached to it that includes the original object. That list is called activeFundAssetListJSON.

              We set these relationships up for client-side calculations and none of this data is editable. Further, we've configured our records so none of this data is ever submitted back to the server either.

              We need to have these relationships client-side. And, this has worked without issue for years now. So, what's the resolution? Ideally, there could be some way to allow editRecord() to only evaluate or clone properties that are actually available for editing in the ValuesManager or DynamicForm. Perhaps an extra param where we could turn off this deep recursion when there are only a handful of properties actually available for editing in the ValuesManager or Form?

              Comment


                #8
                We've changed things so that only data described by a DataSourceField is recursively cloned whereas other data is not. This should fix your issue assuming your pointer over to the related records is not a DataSourceField value.

                Comment


                  #9
                  Hi, that definitely fixed the immediate problem. But, once we do further testing, I fear we are going to have other problems.

                  We do define the pointer as a Datasource field like this:
                  <field name="fundJSON" type="Fund" multiple="false" hidden="true" displayOnly="true" />

                  The reason we do that is because, in some cases, we populate this value server-side to deliver an updated object to the browser and synchronize.

                  So, removing the field definition solved the problem but since we set this value server-side, I'm reluctant to accept this as the final solution. The best solution for us would not be to simply ignore fields that are not listed in the Datasource fields as you've done. Would it be possible to ignore fields where the type is another DataSource? The field definition above lists type="Fund". So, could we have recursive cloning not happen when the type attribute is another datasource? That would be the best solution for us.

                  In the meantime, this lets us continue with some more in-depth testing of the latest nightly.

                  Comment

                  Working...
                  X