Open Bug 1763216 Opened 3 years ago Updated 3 years ago

Extension works for couple of weeks then all of the sudden geckoview starts to report "Could not find extension"

Categories

(GeckoView :: Extensions, defect, P5)

Firefox 92
Unspecified
All
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: contact, Unassigned)

Details

Steps to reproduce:

Using Geckoview as detailed in the examples with a custom extension.

Actual results:

The extension works for 3-4 weeks and then all of the sudden at startup I get this error:

D/GeckoViewConsole: Could not find extension with id=messaging@my_app

Complete log:

2022-04-05 09:59:05.405 4159-4582/my.app D/GeckoViewConsole: onEvent GeckoView:WebExtension:EnsureBuiltIn {"locationUri":"resource://android/assets/messaging/","webExtensionId":"messaging@my_app"}
2022-04-05 09:59:06.838 4159-4159/my.app I/MessageDelegate: Extension installed: WebExtension {location=resource://android/assets/messaging/, id=messaging@my_app, flags=0}
2022-04-05 09:59:06.847 4159-4159/my.app I/WebExtension: releasePendingMessages: extension=messaging@my_app nativeApp=browser session=null
2022-04-05 09:59:07.066 4159-4582/my.app D/GeckoViewConsole: onEvent GeckoView:ActionDelegate:Attached {"extensionId":"messaging@my_app"}
2022-04-05 09:59:07.067 4159-4582/my.app D/GeckoViewConsole: Could not find extension with id=messaging@my_app
2022-04-05 09:59:07.070 4159-4582/my.app D/GeckoViewConsole: onEvent GeckoView:WebExtension:SetPBAllowed {"allowed":true,"extensionId":"messaging@my_app"}

Expected results:

It should continue to work normally all time.

Solution, either to completely reinstall the app or rename the extension id or doing a reset for app data using the Android system UI.

This is how I install the addon:

    private void installAddon() {

        try {

            final String uri = "resource://android/assets/messaging/";

            sGeckoRuntime.getWebExtensionController().setPromptDelegate(sExtensionManager);

            sGeckoRuntime.getWebExtensionController()
                .ensureBuiltIn("resource://android/assets/messaging/", "messaging@my_app")
                .accept(
                    extension - > {
                        Log.i("MessageDelegate", "Extension installed: " + extension);
                        requireActivity().runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                assert extension != null;
                                extension.setMessageDelegate(messageDelegate, "browser");
                                sGeckoRuntime.getWebExtensionController().setAllowedInPrivateBrowsing(
                                    extension, true);
                            }
                        });

                    },
                    e - > Log.e("MessageDelegate", "Error registering WebExtension", e)
                );
        } catch (Exception e) {
            Log.e("installAddon", e.getMessage());
        }
    }

Using Geckoview as detailed in the examples with a custom extension.

Thanks for reporting this bug. Are you using your own app that embeds GeckoView? In which GeckoView versions have you seen this bug? Is this a recent regression?

I will need to ask the GeckoView engineers if this looks like a bug in the GeckoView library or in Gecko's extension code itself.

Yes I am (In reply to Chris Peterson [:cpeterson] from comment #2)

Using Geckoview as detailed in the examples with a custom extension.

Thanks for reporting this bug. Are you using your own app that embeds GeckoView? In which GeckoView versions have you seen this bug? Is this a recent regression?

I will need to ask the GeckoView engineers if this looks like a bug in the GeckoView library or in Gecko's extension code itself.

Yes, I have developed an application which embeds GeckoView. I see this issue in version 92.0.20210922161155.

Yes, I have developed an application which embeds GeckoView. I see this issue in version 92.0.20210922161155.

Some debugging suggestions:

  • Version 92 is pretty old. Try updating to the latest GeckoView version (99) to see if the problem still happens.
  • Try installing one of the Fenix extensions from https://addons.mozilla.org/en-US/android/. Maybe there is something different about your messaging@my_app extension that causes the problem?
Severity: -- → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.