Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS: modify route creates additional point #1726

Closed
zstadler opened this issue May 20, 2022 · 10 comments
Closed

iOS: modify route creates additional point #1726

zstadler opened this issue May 20, 2022 · 10 comments
Labels
App Native application related issues bug

Comments

@zstadler
Copy link
Member

Bug

What really happened

When using drag to create a new point along an existing route on an iOS device, the result route has two new points: one point where the drag started and another point where the drag ended.

What I did that caused the issue - step by step

  • Create a new route with just a start and end points
  • Drag a from any point along the route to a new location

My environment

  • Operating System and version: iOS
  • Web Browser and version: App
@HarelM
Copy link
Member

HarelM commented May 24, 2022

I've tested this on iOS 15.0 and this issue does not exist.
When upgrading to iOS 15.4 the issue appears.
This is probably not related, but might show on a general problem with 15.4 version:
https://developer.apple.com/forums/thread/703648
It's says in the end that 15.5 RC 2 seems to solve this, so It might be better to wait a bit for the releases before jumping into trying to solve this...

@HarelM HarelM added App Native application related issues bug labels May 24, 2022
@HarelM
Copy link
Member

HarelM commented Jun 17, 2022

I've checked the console log for the above related errors and it doesn't seem to be related.
I've also added some console log to try and better understand this issue.
What I see is basically a click I did not make that happens shortly after drag end is finishing the execution in the place where I started the drag.
I'm not sure If I should keep a variable letting me know when was the last time a click was completed and ignore clicks that are "too fast" or open a ticket for iOS.
It seems that this happens more often if I "long press" before starting the drag operation, i.e. click and not move my finger for a few seconds and only after that move it to the desired location.

@HarelM
Copy link
Member

HarelM commented Jun 19, 2022

I've looked even deeper into this and I see that the following events are fired:

  1. touchstart
  2. touchend
  3. mousedown
  4. mouseup

This happens when I long click, it doesn't have to be a mid route point - i.e. simpler reproductions:

  1. delete all routes
  2. click the pencil to start edit
  3. long click on the map
  4. --> instead of only the green point appearing there are now two points the green and the red one on top of the other.
    This doesn't happen on safari mobile, and on android.

The preventDefault() should've handled this, but it doesn't for some reason...
I've also tried to create a very simple maplibre-gl cordova app to try and reproduce this, but it doesn't reproduce for some reason :-(

@HarelM
Copy link
Member

HarelM commented Jun 19, 2022

Further investigation reveals this is related to a plugin we use, I opened an issue with it:
ionic-team/cordova-plugin-ionic-webview#670
But looking at the code of the plugin, this seems like a configuration of the webkit or something so I don't have high hopes there...

@HarelM
Copy link
Member

HarelM commented Jun 21, 2022

The issue in the linked branch is solved.
The drawback is that the data stored is not passed across the update.
There's still an issue with the animation images in android, but overall everything else seems to be working as expected.

@HarelM
Copy link
Member

HarelM commented Jun 21, 2022

Changes that needs to be tested before this can be released (iOS, Android, Web):

  • GPS icon is visible
  • POI animation for empty image POIs
  • Fonts and icons are loading well on the map
  • Mobile only - Sound for when you do not follow a route
  • Mobile only - Offline map can be seen well

@HarelM
Copy link
Member

HarelM commented Jun 25, 2022

There's a question whether the following issue will also create a situation where users will loose their local storage: #1698. Since this issue exists for some time now, I prefer to keep it open just a bit longer in order to avoid all users loosing their data due to the fix proposed here.
I'll try and see how complicated it is to solve #1698 in order to do it in one go.

@HarelM
Copy link
Member

HarelM commented Jun 25, 2022

Another direction is to try and use the same scheme and hostname used in ionic-webview.
Android:

    <preference name="scheme" value="http"/>
    <preference name="hostname" value="localhost"/>
    <allow-navigation href="http://localhost/*"/>

And this part:
http://www.javawenti.com/?post=311176 - i.e. replace type='module' with type='text/javascript' in index.html.
iOS:

    <preference name="iosScheme" value="ionic"/>
    <preference name="hostname" value="localhost"/>

and the following edit for iOS only in file.service:
return (window as any).WkWebView.convertFilePath(this.fileSystemWrapper.applicationDirectory + "www/" + relativePath);

This is still not running properly, so I'm not even sure it will keep the data, but if this direction is possible, it's a lot smaller than migrating to Capacitor...

@HarelM HarelM modified the milestones: Version 9.12.130, Next Release Jul 8, 2022
@HarelM
Copy link
Member

HarelM commented Aug 3, 2022

This will be fixed by migrating to Capacitor. #1698

HarelM added a commit that referenced this issue Aug 10, 2022
* iOS: modify route creates additional point #1726 - remove webview plugin

* #1726 - Fix iOs build (I hope), fix lottie poi animation

* #1726 - Fix iOS build plugin name problem, fix tests

* Use the plugin from the oroginal author and not from the fork

* #1762 - remove incorrect unused import

* Update to latest webview fix

* #1698 - Migrate to Capacitor - remove plugins and add capacitor

* #1698 - Migrate to Capacitor - Added purchase plugin

* #1698 - Migrate to Capacitor - Added sqlite-ext plugin

* #1698 - Migrate to Capacitor - add cordova-plugin-file

* #1698 - Migrate to Capacitor - Added cordova-plugin-filetransfer

* #1698 - Migrate to Capacitor - Fixed file plugin and added social sharing plugin

* #1698 - Migrate to Capacitor - Add background geolocation plugin

* #1698 - Migrate to Capacitor - update CI code

* #1698 - Migrate to Capacitor - Add app and device plugins, fix CI

* #1698 - Migrate to Capacitor - Add screen brightness and keep awake

* #1698 - Migrate to Capacitor - Added capacitor camera plugin

* #1698 - Migrate to Capacitor - Fix camera compilation error

* #1698 - Migrate to Capacitor - Reduce cordova name in app, fix camera plugin usage

* #1698 - Migrate to Capacitor - Fix export plist options to include provisioning profile

* #1698 - Migrate to Capacitor - Fix icons, remove cordova config

* #1698 - Migrate to Capacitor - Fix Add missing icons

* #1698 - Migrate to Capacitor - Fix icons

* #1698 - Migrate to Capacitor - improve url handling

* #1698 - Migrate to Capacitor - added ouath plugin

* #1698 - Migrate to Capacitor - added device orienation, remove is cordova, removed resume events

* #1698 - Migrate to Capacitor - fix ios crash due to missing preferences

* #1698 - Migrate to Capacitor - Fix iOS crash due to missing preference

* #1698 - Migrate to Capacitor - Added vibration, removed some TODOs

* #1698 - Migrate to Capacitor - replace capacitor file system with cordova due to large files, add in comment the migration to capasitor sqlite

* #1698 - Migrate to Capacitor - missing files in previous commit - remove capacitor filesystem

* #1698 - Migrate to Capacitor - Fix tests

* #1698 - Migrate to Capacitor - replace cordova sqlite with capacitor's

* #1698 - Migrate to Capacitor - Fix ios compilation, fix cache folder in android

* #1698 - Migrate to Capacitor - Fix sqlite-community with patch-package

* #1698 - Migrate to Capacitor - upgrade to angular 14

* #1698 - Migrate to Capacitor - Upgrade to material 13

* #1698 - Migrate to Capacitor - update flex layout

* #1698 - Migrate to Capacitor - fix lint, update material to 14

* #1698 - Migrate to Capacitor - update other dependencies

* #1698 - Migrate to Capacitor - remove more todos

* #1698 - Migrate to Capacitor - Hide statusbar instaed of using a plugin

* #1698 - Migrate to Capacitor - update ios version using patch package

* #1698 - Migrate to Capacitor - update geolocation plugin version to 2.0.5

* #1698 - Migrate to Capacitor - change ios default version

* #1698 - Migrate to Capacitor - Fix scss encoding and split it back

* #1698 - Migrate to Capacitor - Fix pois sidebar and turn them into buttons

* #1698 - Migrate to Capacitor - update eslint version

* #1698 - Migrate to Capacitor - update capacitor to version 4.0.1

* #1698 - Migrate to Capacitor - update jdk to 11

* #1698 - Migrate to Capacitor - fix android icon

* #1698 - Migrate to Capacitor - update more dependecies

* #1698 - Migrate to Capacitor - fix icon and upgrade geolocation plugin to version 2.0.6

* #1698 - Migrate to Capacitor - Fix reading a file issue due to a bug in the cordova plugin

* #1698 - Migrate to Capacitor - Fix zoom text size

* #1698 - Migrate to Capacitor - fix merge from main

* #1698 - Migrate to Capacitor - Move out of @ionic-native into @awesome-cordova-plugins

* #1698 - Migrate to Capacitor - Fix ios cache folder, small UI improvement in progess dialog

* #1698 - Migrate to Capacitor -  added --prod to sync

* #1698 - Migrate to Capacitor - Fix cap sync and remove the set-capacitor-version package

* #1698 - Migrate to Capacitor - remove set-capacitor-version

* #1698 - Migrate to Capacitor - Add CI print for the files that have changed

* #1698 - Migrate to Capacitor - Fix CI version issues

* #1698 - Migrate to Capacitor - Fix ios version change

* #1698 - Migrate to Capacitor - update d3 to latest version and remove angular wrapper

* #1698 - Migrate to Capacitor - See if android build tools are not needed?

* #1698 - Migrate to Capacitor - remove unneeded code from android ci script

* #1698 - Migrate to Capacitor - Added database migration code

* #1698 - Migrate to Capacitor - Fix database name issue

* #1698 - Migrate to Capacitor - Added native audio to support sound notifications

* #1698 - Migrate to Capacitor - Fix file not found exception

* #1698 - Migrate to Capacitor - Fix android database file location

* #1698 - Migrate to Capacitor - remove commonjs warnings

* #1698 - Migrate to Capacitor - add ios scheme to preserve local storage

* #1698 - Migrate to Capacitor - code review changes
@HarelM
Copy link
Member

HarelM commented Aug 10, 2022

Fixed by #1743

@HarelM HarelM closed this as completed Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Native application related issues bug
Projects
None yet
Development

No branches or pull requests

2 participants