[Purpose Plugin] Reset pending reply serial when aborting
ClosedPublic

Authored by broulik on Dec 7 2019, 9:18 PM.

Details

Summary

When the QMenu is closed or the Purpose job finishes, we make sure to send a reply out and reset the pending reply serial.
However, when we determined on the host side that we cannot share the contents, we send a reply but don't reset the pending reply serial, having every subsequent purpose request fail until reloading the extension or restarting the browser.

Test Plan

5.17

(patched out the "isTrusted" check for testing)

  • called navigator.share({title: "test"})
  • then called navigator.share({url: "test})

Previously, the url request would fail as the title request (which is valid as far as canShare is concerned in the extension but not for Purpose on the host side) got rejected but not properly reset.
With this patch the url request opens purpose menu as expected

Diff Detail

Repository
R856 Plasma Browser Integration
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Dec 7 2019, 9:18 PM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 7 2019, 9:18 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Dec 7 2019, 9:18 PM
fvogt accepted this revision.Dec 7 2019, 9:48 PM
This revision is now accepted and ready to land.Dec 7 2019, 9:48 PM
This revision was automatically updated to reflect the committed changes.