Esri / offline-editor-js

ArcGIS JavaScript library for handling offline editing and tiling.
http://esri.github.io/offline-editor-js/demo/
Apache License 2.0
159 stars 142 forks source link

Rendering New Features after Multiple Full Offline Mode Restarts #434

Closed webmapsolutions closed 8 years ago

webmapsolutions commented 8 years ago

We have been updating the appcache-twofeatureslayer-noedit.html to include editing in the current code base. We have found an issue relating to adding a new feature and rendering when in full offline mode with multiple restarts. The following shows a video of the workflow:

http://webmapsolutions.com/demos/FullOfflineBug/FullOfflineBug.html

here is a link to the sample app:

http://www.webmapsolutions.com/offline-editor-v3/samples/appcache-twofeatureslayer-edit.html

andygup commented 8 years ago

Hi Matt, can you paste the console log stack trace here? Thanks!

andygup commented 8 years ago

Matt, any luck on this?

webmapsolutions commented 8 years ago

Here we go Andy. Workflow

  1. Take app offline and reload
  2. Add a new feature
  3. Reload again in offline mode. New feature does not render

http://www.webmapsolutions.com/offline-editor-v3/samples/appcache-twofeatureslayer-edit.html

See the attached stack trace Andy taken on app reload (from 3 above).

On 4 January 2016 at 09:39, Matt Sheehan matt@webmapsolutions.com wrote:

On my list today Andy. See if i can knock it out in a few.

On 4 January 2016 at 09:28, Andy notifications@github.com wrote:

Matt, any luck on this?

— Reply to this email directly or view it on GitHub https://github.com/Esri/offline-editor-js/issues/434#issuecomment-168724213 .

Matt Sheehan | WebMapSolutions

Mobile: 801-733-0723 | Email: matt@webmapsolutions.com Email%3Amatt@webmapsolutions.com

Matt Sheehan | WebMapSolutions

Mobile: 801-733-0723 | Email: matt@webmapsolutions.com Email%3Amatt@webmapsolutions.com

andygup commented 8 years ago

Can you please copy-n-paste the stack track directly into the issue here so we have a permanent record on github? That will make it sooo much easier for me, thanks!

webmapsolutions commented 8 years ago

Of course. Will do.

On 4 January 2016 at 11:33, Andy notifications@github.com wrote:

Can you please copy-n-paste the stack track directly into the issue here so we have a permanent record on github? That will make it sooo much easier for me, thanks!

— Reply to this email directly or view it on GitHub https://github.com/Esri/offline-editor-js/issues/434#issuecomment-168761685 .

Matt Sheehan | WebMapSolutions

Mobile: 801-733-0723 | Email: matt@webmapsolutions.com Email%3Amatt@webmapsolutions.com

webmapsolutions commented 8 years ago

Stack trace: stack2 stack1 stack4 stack3

andygup commented 8 years ago

Take a look at your console log real-time while offline and doing step 2.

I only glanced at the code, but from the errors I saw it's very possible you aren't correctly taking the feature layer offline.

webmapsolutions commented 8 years ago

The code here extends your sample Andy: appcache-twofeatureslayer-noedit.html. In full offline mode, the new feature is being added to indexDB. When going back online applyedits adds the new feature. It looks like a rendering issue whereby new edits in full offline mode after a restart are not being rendered. Again you can test the app and see the code here:

http://www.webmapsolutions.com/offline-editor-v3/samples/appcache-twofeatureslayer-edit.html

On 4 January 2016 at 14:44, Andy notifications@github.com wrote:

Take a look at your console log real-time while offline and doing step 2.

I only glanced at the code, but from the errors I saw it's very possible you aren't correctly taking the feature layer offline.

— Reply to this email directly or view it on GitHub https://github.com/Esri/offline-editor-js/issues/434#issuecomment-168818973 .

Matt Sheehan | WebMapSolutions

Mobile: 801-733-0723 | Email: matt@webmapsolutions.com Email%3Amatt@webmapsolutions.com

andygup commented 8 years ago

I'll dig into and see what I find. This may be related specifically to feature layer ADD functionality within the library.

Also a gentle reminder that the Editor Widget isn't supported for full offline with the OfflineEditAdvanced library. I know you've worked with those issues before, so don't be surprised if the widget has issues that are separate from the capabilities of OfflineEditAdvanced.

webmapsolutions commented 8 years ago

Just catching up on emails. Follow up on my last email . A custom editor. I don't think the bug I have shared relates to the editor widget. But Again have we seen issues with the editor widget in full offline mode that can be documented?

On Monday, January 4, 2016, Andy notifications@github.com wrote:

I'll dig into and see what I find. This may be related specifically to feature layer ADD functionality within the library.

Also a gentle reminder that the Editor Widget isn't supported for full offline with the OfflineEditAdvanced library. I know you've worked with those issues before, so don't be surprised if the widget has issues that are separate from the capabilities of OfflineEditAdvanced.

— Reply to this email directly or view it on GitHub https://github.com/Esri/offline-editor-js/issues/434#issuecomment-168847368 .

Matt Sheehan | WebMapSolutions

Mobile: 801-733-0723 | Email: matt@webmapsolutions.com Email%3Amatt@webmapsolutions.com

andygup commented 8 years ago

Unfortunately, no. I have only credible second-hand information via email and phone. No one has opened a github issue here that we could use.

andygup commented 8 years ago

Matt, I can't get the application's graphic display to stabilize while it's online using Chrome or Chrome Canary. After the app loads online I can zoom way out, click on the map to move it and the graphics literally start jumping all around the map, some of them even disappear as you zoom in/out.

I also noticed that when you click to add a graphic that it doesn't draw in the correctly location. It draws about 120 pixels below the spot that you click. Maybe try moving the Editor Widget to one of the sides of the app.

If the map app is online after the initial load, then all rendering is handled natively by the ArcGIS API for JavaScript and not by this library.

My recommendations are:

webmapsolutions commented 8 years ago

I cannot reproduce this behavior Andy. Odd again since this is a simple extension of your sample. For now maybe just do not zoom simply load and go offline.

I have reworked layout so now we do not see the 120 px new point out of place issue:

http://webmapsolutions.com/offline-editor-v3/samples/appcache-twofeatureslayer-edit.html

But the rendering issue remains the same ........ go offline, reload the app, add a point, reload, new point is not visible (hit show pending button and you see the new point is stored) .. go back online applyedits runs and new point appears.

On 5 January 2016 at 17:24, Andy notifications@github.com wrote:

Matt, I can't get the application's graphic display to stabilize while it's online using Chrome or Chrome Canary. After the app loads online I can zoom way out, click on the map to move it and the graphics literally start jumping all around the map, some of them even disappear as you zoom in/out.

I also noticed that when you click to add a graphic that it doesn't draw in the correctly location. It draws about 120 pixels below the spot that you click. Maybe try moving the Editor Widget to one of the sides of the app.

If the map app is online after the initial load, then all rendering is handled natively by the ArcGIS API for JavaScript and not by this library.

My recommendations are:

  • See if you can zoom out and reproduce the behavior I'm seeing.
  • If you are seeing what I'm seeing then remove the Editor Widget.
  • Build a button that programmatically adds a point
  • Programmatically add point functionality while offline, then restart the app.

— Reply to this email directly or view it on GitHub https://github.com/Esri/offline-editor-js/issues/434#issuecomment-169177176 .

Matt Sheehan | WebMapSolutions

Mobile: 801-733-0723 | Email: matt@webmapsolutions.com Email%3Amatt@webmapsolutions.com

andygup commented 8 years ago

For now maybe just do not zoom simply load and go offline.

Maybe or maybe not. There is potentially a problem and I'm wondering if it's related to the disappearing features after an offline restart. I was able to repro the issue I described on three different browsers: Chrome, Chrome Canary and Firefox.

But the rendering issue remains the same

I understand. I still need you guys to test bullets 2 - 4 in my recommendations above. I'm not able to troubleshoot the internals of JavaScript API FeatureLayer rendering. So, we need a easy way to try and isolate if the Editor Widget is or is not causing the problem.

I can verify the edit gets added to the database as an ADD. We've had suspicions in the past that the Editor Widget changes how a graphic gets created on a feature layer after an offline restart, but haven't been able to put a finger on if that's true or not.

webmapsolutions commented 8 years ago

I see it now Andy. How odd. I'll dig deeper tomorrow, and run through points 2-4. I'm 99% sure this has nothing to do with the rendering issue, since I have seen this non-render in the core app we have been building.Thx

On 5 January 2016 at 18:40, Andy notifications@github.com wrote:

For now maybe just do not zoom simply load and go offline.

Maybe or maybe not. There is potentially a problem and I'm wondering if it's related to the disappearing features after an offline restart. I was able to repro the issue I described on three different browsers: Chrome, Chrome Canary and Firefox.

But the rendering issue remains the same

I understand. I still need you guys to test bullets 2 - 4 in my recommendations above. I'm not able to troubleshoot the internals of JavaScript API FeatureLayer rendering. So, we need a easy way to try and isolate if the Editor Widget is or is not causing the problem.

I can verify the edit gets added to the database as an ADD. We've had suspicions in the past that the Editor Widget changes how a graphic gets created on a feature layer after an offline restart, but haven't been able to put a finger on if that's true or not.

— Reply to this email directly or view it on GitHub https://github.com/Esri/offline-editor-js/issues/434#issuecomment-169191682 .

Matt Sheehan | WebMapSolutions

Mobile: 801-733-0723 | Email: matt@webmapsolutions.com Email%3Amatt@webmapsolutions.com

webmapsolutions commented 8 years ago

I removed the Editor Widget. Still saw the odd rendering when zoom out. Reworked code which should have fixed this oddity:

http://webmapsolutions.com/offline-editor-v3/samples/appcache-twofeatureslayer-edit-wms.html

If we can confirm this non-rendering issue is an Editor Widget related problem we can close this bug and we will start work on looking into building a sample which does not rely on the Editor Widget.

andygup commented 8 years ago

Thanks, I know it was a long shot but now we can confidently call that a rendering bug in the JS API. I'll move that item to my TODO list and follow up on it separately.

webmapsolutions commented 8 years ago

If we are sure this has nothing to do with the library Andy, that makes sense. Its a bugger we cannot get access to the Editor Widget, what is gained by not open sourcing the code?

On 6 January 2016 at 09:21, Andy notifications@github.com wrote:

Thanks, I know it was a long shot but now we can confidently call that a rendering bug in the JS API. I'll move that item to my TODO list and follow up on it separately.

— Reply to this email directly or view it on GitHub https://github.com/Esri/offline-editor-js/issues/434#issuecomment-169376331 .

Matt Sheehan | WebMapSolutions

Mobile: 801-733-0723 | Email: matt@webmapsolutions.com Email%3Amatt@webmapsolutions.com

andygup commented 8 years ago

Closing this as a duplicate of #437