Closed wmbeers closed 2 years ago
See also #72, a fairly reliable way to trigger this problem.
Errors captured when investigating this with the user:
description: "Unable to get property 'spatialReference' of undefined or null reference", message: "Unable to get property 'spatialReference' of undefined or null reference", name: "TypeError", number: -2146823281, stack: "TypeError: Unable to get property 'spatialReference' of undefined or null reference at simplify (https://js.arcgis.com/3.29/:2697:351) at Anonymous function (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:19670) at _buildAnalysisAreaBufferEdits (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:19549) at saveAnalysisAreaBuffers (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:7266) at Anonymous function (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:6203) at l (https://js.arcgis.com/3.29/:108:242) at k (https://js.arcgis.com/3.29/:108:174) at resolve (https://js.arcgis.com/3.29/:110:267) at Anonymous function (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:7192)" }
rejected at a (https://js.arcgis.com/3.29/:109:154)
at l (https://js.arcgis.com/3.29/:108:407)
at k (https://js.arcgis.com/3.29/:108:174)
at e.resolve (https://js.arcgis.com/3.29/:110:267)
at callback (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:7111)
at https://www.fla-etat.org/est/dwr3/engine.js:1037:35
at Object.logHandlerEx (https://www.fla-etat.org/est/dwr3/engine.js:2553:9)
at Object.handleCallback (https://www.fla-etat.org/est/dwr3/engine.js:1033:29)
at eval (eval at dwr.engine._executeScript (https://www.fla-etat.org/est/dwr3/engine.js:720:6), <anonymous>:10:19)
at eval (eval at dwr.engine._executeScript (https://www.fla-etat.org/est/dwr3/engine.js:720:6), <anonymous>:11:3)
----------------------------------------
Error
at e.then.b.then (https://js.arcgis.com/3.29/:111:77)
at Object.saveAnalysisAreasAndShowAnalysisOptions (https://www.fla-etat.org/est/secure/map/js/gis/dijit/AoiEditor.js:6:6187)
at HTMLSpanElement.
relevant minified/expanded (but enough to narrow down in real source) code: _buildAnalysisAreaBufferEdits: function() { var a = this; this._buildAnalysisAreasFromFeatures(), this.loadingOverlay.show("Constructing analysis area buffers..."); var e = this.layers.analysisAreaBuffer.graphics , t = this.analysisAreas() , n = { adds: [], updates: [], deletes: e.filter(function(e) { return !this.getAnalysisAreaModel(e.attributes.FK_PROJECT_ALT) }, this) } , s = new b , o = []; return t.forEach(function(i) { var r = new b , e = i.features().map(function(e) { return (e.buffer || e.graphic).geometry }); o.push(r), esriConfig.defaults.geometryService.simplify(e).then(function(e) {
Stepping through t.forEach above, altNumber=1, features [{...geometry.paths[42]... seems ok But it still wants to try to work through the empty analysis area, even after I delete the feature and reload, and remnant record in t_project_alt_aoi is a problem somehow reload whole viewer
Perhaps related, I note a few new issues not reported by users:
Further testing with Mike today, we observed behavior which seems to indicate that clicking Next too quickly after finishing the creation of a line (not extracting) gets it into the state where the "Unable to get property 'spatialReference' of undefined or null reference" exception occurs. First attempt to fix will be disabling the Next button while the user is interactively working on a feature (still in drawing mode, or a recent drag of a feature vertex), and re-enabling after on-the-fly saving is complete.
How often can you reproduce it: Sometimes
Description:
Under certain circumstances the behind-the-scenes creation of analysis areas (features in S_AOI representing the geographic union of buffers of features created by the user) fails, resulting in errors running analysis and reports. It often can recover if you close the AOI, re-open it, and try again, but not always.
I do not have clear steps to reproduce, but it can sometimes be triggered by using the undo/redo functionality in conjunction with deleting a feature, or by extracting a zero-length line from the RCI basemap (an issue to be addressed separately).