Page MenuHomePhabricator

[Cashtab] Handle port disconnects in extension
ClosedPublic

Authored by bytesofman on Dec 7 2023, 18:46.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC33b157b31fa6: [Cashtab] Handle port disconnects in extension
Summary

T3370

Handle port disconnect event to prevent 'port disconnected' error

In prod use, we are seeing the connection between a web page and the cashtab extension disconnect and fail to reconnect. I have not been able to reliably repeat it, but it tends to happen after several extension requests, or after a period of inactivity followed by additional message requests.

In testing, I have been unable to repeat the issue on a local extension if the event is handled. I can't say if this is actually a fix, but I also can't really test the problem if this prevents me from repeating the issue. Getting this change published and seeing if the bug recurs would be useful info for ironing this out.

Test Plan

npm run extension completes; observe no real change to the code

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bytesofman updated this revision to Diff 43493.

backing out unrelated change

bytesofman retitled this revision from [Cashtab] Fix port disconnects in extension to [Cashtab] Handle port disconnects in extension.Dec 7 2023, 18:47
bytesofman edited the summary of this revision. (Show Details)
Fabien added inline comments.
cashtab/extension/src/service_worker.js
53 ↗(On Diff #43493)

not even a log ?

cashtab/extension/src/service_worker.js
53 ↗(On Diff #43493)

In testing, I used a log -- but you just get 100s of the log statements since this event happens every time a browser tab is closed.

This revision is now accepted and ready to land.Dec 7 2023, 19:32