You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/08/07 20:04:44 UTC

[GitHub] [cordova-android] skmbr opened a new issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

skmbr opened a new issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315


   # Feature Request
   
   ## Motivation Behind Feature
   As per the discussion on this issue: https://github.com/apache/cordova-android/pull/1137#issuecomment-824881641 localStorage data will no longer be accessible when the origin changes from file:// to https://localhost
   
   
   ## Feature Description
   The discussion above suggests incorporating this functionality into the core of the android platform so I was wondering if this was in the plan, or if anyone can suggest another way of achieving this now?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] roitto commented on issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
roitto commented on issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315#issuecomment-900995782


   If the AndroidInsecureFileModeEnabled attribute is set to true, will the play store still accept the application updates?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] roitto commented on issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
roitto commented on issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315#issuecomment-900995782


   If the AndroidInsecureFileModeEnabled attribute is set to true, will the play store still accept the application updates?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315#issuecomment-901067292


   > If the AndroidInsecureFileModeEnabled attribute is set to true, will the play store still accept the application updates?
   
   For the foreseeable future, I cannot see why not. By default, the webview always used local file paths and everyone running cordova-android@9 and earlier would be using the local filepaths as well. Google hasn't gave any signal that it will start rejecting these apps because they are using file:// based paths.
   
   They are however recommend people to start using the web asset loader, which is what cordova-android@10 implements and uses by default.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315#issuecomment-901067292


   > If the AndroidInsecureFileModeEnabled attribute is set to true, will the play store still accept the application updates?
   
   For the foreseeable future, I cannot see why not. By default, the webview always used local file paths and everyone running cordova-android@9 and earlier would be using the local filepaths as well. Google hasn't gave any signal that it will start rejecting these apps because they are using file:// based paths.
   
   They are however recommend people to start using the web asset loader, which is what cordova-android@10 implements and uses by default.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315#issuecomment-895322824


   > I'm not sure a migration option is needed. Looks like Google already thought of this when they added a "preserveLegacyExternalStorage" attribute:
   > 
   > https://developer.android.com/reference/android/R.attr#preserveLegacyExternalStorage
   > 
   > I haven't verified if it works as expected, but it seems like it's what you're looking for. Good luck!
   
   This is not related to the OP request whatsoever. The OP is talking about the webview's data storage containers, which are bound to the document's origin. Cordova-android@9 and earlier used a file:// scheme so the document's origin is `null` (or empty), but cordova-android@10 and moving forward the scheme uses https://localhost (by default), making the origin `https://localhost`
   
   `preserveLegacyExternalStorage` is for how the app itself stores or accesses "external" storage (e.g.: public folders).
   
   We had a discussion on how to deal with the origin changes in this [mailing list thread](https://lists.apache.org/thread.html/rdf5efb2f33b1ced770297326c4f9fb87a1123d93f5ca0b271b8797c7%40%3Cdev.cordova.apache.org%3E)
   
   In a short summary, the Apache volunteer team decided not to handle data migration ourselves and decided it is up to the community users to develop a plugin to migrate the data themselves.
   
   If you aren't ready to migrate data, then the `AndroidInsecureFileModeEnabled` preference flag can be set to true, which should make the platform use `file://` based URLs, thus making the origin unchanged from cordova-android@9
   
   I'm closing this request as it was already decided that Apache won't take responsibility of migrating data.
   
   You won't be able to take this plugin as is for data migration, but you can learn a bit how to migrate local storage data by looking at the plugin [sources](https://github.com/totalpave/cordova-plugin-crosswalk-data-migration). The two major differences is that modern chrome webviews doesn't use SQLite databases anymore, it uses LevelDB, and xwalk directories are only for users using crosswalk.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek closed issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
breautek closed issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315#issuecomment-895331839


   Yah, personally I would move away from relying on browser storage, and part of your migration strategy might be using that native storage plugin.
   
   In my apps, I've migrated to either using flat files using cordova-plugin-file, or SQLite using an sqlite plugin -- depending on the complexity of the data being stored in the app.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] skmbr commented on issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
skmbr commented on issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315#issuecomment-895336426


   It's fairly simple, just settings mainly, so SQLite is definitely an option, especially as the owner of the nativestorage plugin has said he doesn't have time to actively maintain it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] revie commented on issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
revie commented on issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315#issuecomment-895312135


   I'm not sure a migration option is needed. Looks like Google already thought of this when they added a "preserveLegacyExternalStorage" attribute:
   
   https://developer.android.com/reference/android/R.attr#preserveLegacyExternalStorage
   
   I haven't verified if it works as expected, but it seems like it's what you're looking for. Good luck!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] skmbr commented on issue #1315: Automatic migration of localStorage when moving to android@10 / WebViewAssetLoader

Posted by GitBox <gi...@apache.org>.
skmbr commented on issue #1315:
URL: https://github.com/apache/cordova-android/issues/1315#issuecomment-895330189


   Thanks for clearing that up @breautek
   
   I will keep an eye out for a plugin and have a proper read through that email thread as there seem to be some discussions on migrations strategy in there too.
   
   I might also look at migrating to something like https://github.com/TheCocoaProject/cordova-plugin-nativestorage and then enable WebViewAssetLoader once I'm happy enough users are migrated.
   
   Thanks for your help!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org