-
Notifications
You must be signed in to change notification settings - Fork 343
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
fix: Cleanup old web-ext run artifacts dir when we are connecting to an android device #1856
Conversation
Hi @Vishalghyv, the changes in this pull requests cannot cleaning up the old files stored by a previous The approach suggested by @Rob--W in #1591 (comment) is to make web-ext run to remove the directories from the target device sdcard that starts with the In the src/extension-runners/firefox-android.js module that you are changing in this PR there is already some code that is interacting with the target device over adb, take a look at that code and think about how you could achieve what Rob is suggesting. As a side note, you don't need to close the pull requests to apply changes on them, you should create a branch (e.g. using something like |
Hey @rpl , Thanks for reviewing my pull request. if (this.selectedArtifactsDir) { If this is not the way, I was thinking of using runShellCommands and directly removing directory using the relative path but checking few conditions before it like directory and permissions |
We are already trying to clear the artifacts dir on the device when web-ext is shutting down, but there are still chances that we may have not been able to remove them (e.g. because we got disconnected from the device or emulator we were connected to over adb, as also mentioned by Rob in this comment #1591 (comment)).
Line 197 in 9735a1f
It would be good to add to the ADBUtils class a new method that does what I described in #1856 (comment) runShellCommands may definitely be useful, but I would also suggest to look if the underlying npm dependency (adbkit) has any additional API method that may be useful to achieve what we need (take a look to the API doc here: https://github.com/openstf/adbkit ) |
superseded by #1866 |
fix: Added cleaning up old files In android
Calling cleanupCallbacks.
Also used
if (selectedArtifactsDir)
{log.debug('Cleaning up artifacts directory on the Android device...');
await adbUtils.clearArtifactsDir(selectedAdbDevice);}
But this caused in decrease of coverage.
So just this.cleanupCallbacks functions is called.
(Fixes #1591)