Setting set_intercept_activation() on a JS CategorisedResult causes scope to claim `returned nullptr from activate` and not activate

Bug #1598969 reported by Stuart Langridge
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
unity-js-scopes
In Progress
Medium
Alexandre Abreu

Bug Description

To test, add CategorisedResult()s in search() as normal, but call cr.set_intercept_activation() on that CategorisedResult. This should call the `activate()` function from the scope.initialize runtime_config. However, it instead throws errors:

Scope (your scope) returned nullptr from activate()
Scope (your scope) threw an exception from activate()

As far as I can tell, this is not being thrown by my code; it happens regardless of what I have in the activate() function, or even if I don't have one at all, and no code inside my activate() function is executed. This, in practice, means it's impossible to write a JS scope which allows tapping on a result item to do anything other than show the preview (for example, launching an app).

Related branches

Changed in unity-js-scopes:
assignee: nobody → Alexandre Abreu (abreu-alexandre)
Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

@alex: The documentation doesn’t actually mention ActivationResponse or even that activate() handlers are possible in scope.initialize(). We should fix this too.

Changed in unity-js-scopes:
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Alexandre Abreu (abreu-alexandre) wrote :

@Stuart: I could repro your issue, could you check if the branch linked works for you (so that at least we have a simple common example)?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.