bryceco / GoMap

OpenStreetMap editor for iPhone/iPad
ISC License
323 stars 41 forks source link

Tag editor freezing, app became unusable #653

Closed euf closed 1 year ago

euf commented 1 year ago

When I try to edit tags on any feature, the apps freezes after the editor is opened. Deleting and reinstalling didn't help. I believe this happened after I added a new custom preset for the editor. What can I do now to continue using the app?

euf commented 1 year ago

Upd: reverting from TestFlight to AppStore version fixed the issue, but all my editor presets seem missing. When I update to Testflight version again, the issue with freezing editor persists.

bryceco commented 1 year ago

This is good information. I had a crash report that said the app was freezing across multiple devices but I don't have any indication of what causes it (it was a hang rather than a crash, so no actual backtrace was available). I also can't replicate a freeze when I define custom presets myself. Can you try to recreate the hang on the beta and see if we can narrow down the problem?

euf commented 1 year ago

I'd be happy to help narrow down the problem. What can I do for that? Recreating hangs on the beta is easy for me, the app freezes every time I open tag editor in the Testflight build. After that, only force exit via task manager helps.

https://user-images.githubusercontent.com/11754264/229447682-ba072d13-bd5b-4984-92cc-eb24b22e3f03.MOV

bryceco commented 1 year ago

When you delete the app it deletes all presets/settings/data, so it makes sense that you lost your presets after deleting.

My understanding is that you can delete the app, reinstall via TestFlight and it hangs. But if you then install the AppStore version (with or without deleting it) then it works okay?

Did the previous beta hang?

euf commented 1 year ago

Okay, so that's what I already tried. I delete the app, then install 3.4.5 (latest) from Testflight, it does freeze. I install 3.4.4 (the previous beta) without deleting, also freeze. I delete the app, install 3.1.4 from App Store, it works correctly. I delete the App Store version, install 3.4.3 (two versions before) from Testflight, still freezes when tag editor is open.

Then I got a little bored and didn't go back further, but if you feel the bug was introduced after 3.2.1 (this is the earliest build available in Testflight), I can spend a couple of hours checking all of them. Also I used Testflight's "report a problem" pop-up after force quitting the app for all three versions. Hope these reports find you and are useful enough to nail down the problem.

bryceco commented 1 year ago

Thanks, I appreciate it. I just saw your bug reports in TestFlight but unfortunately they don't give me any additional information useful for debugging. The other person reporting this issue is using an iPhone SE, which is also a small-screen device, which seems interesting. However I've done testing on an iPhone 5S which is the same screen dimensions and it works fine. I know it's painful but if you could try 3.2.1 and then binary search the in-betweens that would be greatly appreciated! I have a pretty good inventory of devices but I'm not seeing it.

euf commented 1 year ago

I found it! So 3.3.8 is the last version which works correctly on my device. The tag editor freeze begins starting from 3.3.9, and interestingly its release notes say:

How do we find the source of the problem now? Should I export my Custom Presets from openstreetmap.org? (guess .com in the original text is a typo) Have no idea where exactly presets are stored though

bryceco commented 1 year ago

That's great news, thanks so much for researching this. If your presets were successfully stored on the server you can find them at:

https://www.openstreetmap.org/api/0.6/user/preferences.json

You can post them here or send them to me via TestFlight or email.

euf commented 1 year ago

Here is my response from this endpoint (beautified and replaced some cryptographic-looking-strings with xxxxx):

{
  "version": "0.6",
  "generator": "OpenStreetMap server",
  "copyright": "OpenStreetMap and contributors",
  "attribution": "http://www.openstreetmap.org/copyright",
  "license": "http://opendatacommons.org/licenses/odbl/1-0/",
  "preferences": {
    "gomap-userDefinedPresetKeys-001": "\",\"presetList\":[]},{\"appliesToValue\":\"\",\"tagKey\":\"contact:instagram\",\"name\":\"Instagram\",\"appliesToKey\":\"\",\"presetList\":[]},{\"appliesToValue\":\"\",\"tagKey\":\"contact:facebook\",\"name\":\"Facebook\",\"appliesToKey\":\"\",\"presetList\":[]},{\"appliesToValue\":\"\",\"tagKey\":",
    "gomap-userDefinedPresetKeys-002": "\"addr:housename\",\"name\":\"Building Name\",\"appliesToKey\":\"building\",\"presetList\":[]}]",
    "gps.trace.visibility": "public",
    "mangroveidentity-combined-0": "{\"crv\":\"P-256\",\"d\":\"xxxxx\",\"ext\":true,\"key_ops\":[\"sign\"],\"kty\":\"EC\",\"x\":\"xxxxx\",\"y\":\"xxxxx\",\"metadata\":\"Mangrove private key\"}",
    "mangroveidentity-combined-length": "1",
    "mapcomplete-language": "en",
    "mapcomplete-layer-gps_track-enabled": "false",
    "mapcomplete-translation-mode": "false"
  }
}

I guess there are at least two problems:

  1. Escaped JSONs stored in gomap-userDefinedPresetKeys look invalid to me after unescaping.
  2. I definitely remember creating five presets, but three of them had emojis in their names, and they are not present here.
bryceco commented 1 year ago

This is great. There should be a "gomap-userDefinedPresetKeys-000" to go with the other two, so there's a problem with uploading (maybe related to the emoji) and another problem dealing with malformed data during download.

euf commented 1 year ago

I'm very glad my efforts made a difference! If that helps any further, I was using country emojis to mark names in local languages, something like "Name 🇩🇪" for the name:de tag.

P.S. Sorry for the off topic, but do you know by any chance what mangroveidentity- bunch of preferences could mean? Searching the web didn't help, and I'm rather puzzled with its origins

bryceco commented 1 year ago

I have a fix prepared thanks to your help. Seems that the API barfs 🤮 on any emoji.

Does this look familiar? https://mangrove.reviews

tordans commented 1 year ago

Seems that the API barfs 🤮 on any emoji.

I did not follow this in detail but it sounds like an issue that (also) should be fixed upstream, right? Only few apps use the API this way so it might very well we this is the first time it came up...

bryceco commented 1 year ago

Seems that the API barfs 🤮 on any emoji.

I did not follow this in detail but it sounds like an issue that (also) should be fixed upstream, right? Only few apps use the API this way so it might very well we this is the first time it came up...

https://github.com/openstreetmap/openstreetmap-website/issues/4001

bryceco commented 1 year ago

Fixed in 2ad83b916875272ca994d02ae28b5192d36cebc9 and f79fc77ffd07e75c3ff2d761a13bbbe02e3a2cab

euf commented 1 year ago

Thank you so much! Tried 3.4.6, works flawlessly 🔥