aries-framework-go icon indicating copy to clipboard operation
aries-framework-go copied to clipboard

Clean up connections after websocket close

Open borancar opened this issue 3 years ago • 3 comments

Title: Clean up connections after WebSocket close

Description: Make sure we clean up connections by just going through the map and cleaning all the verkeys that match the connection. This is a suboptimal solution, but a connection close is not something happening often.

Fixes https://github.com/hyperledger/aries-framework-go/issues/3349

borancar avatar Aug 26 '22 22:08 borancar

If you like the approach, or if it's acceptable, then I can try to add tests.

borancar avatar Aug 26 '22 22:08 borancar

Codecov Report

Merging #3352 (b1decdf) into main (a66828f) will decrease coverage by 0.05%. The diff coverage is 61.95%.

:exclamation: Current head b1decdf differs from pull request most recent head ffa35a9. Consider uploading reports for the commit ffa35a9 to get more accurate results

@@            Coverage Diff             @@
##             main    #3352      +/-   ##
==========================================
- Coverage   87.89%   87.84%   -0.06%     
==========================================
  Files         330      330              
  Lines       45571    45633      +62     
==========================================
+ Hits        40056    40087      +31     
- Misses       4085     4110      +25     
- Partials     1430     1436       +6     
Impacted Files Coverage Δ
pkg/didcomm/protocol/legacyconnection/service.go 86.74% <ø> (-0.08%) :arrow_down:
pkg/doc/presexch/definition.go 83.26% <59.77%> (-3.08%) :arrow_down:
pkg/didcomm/protocol/legacyconnection/states.go 87.20% <100.00%> (+0.04%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Aug 29 '22 13:08 codecov[bot]

linting with js/wasm..
Error: pkg/didcomm/transport/ws/pool.go:74:20: func `(*connPool).remove` is unused (unused)
func (d *connPool) remove(verKey string) {
                   ^
make: *** [lint] Error 1
Makefile:37: recipe for target 'lint' failed
Error: Process completed with exit code 2.

The unused check is incorrect (or possibly incomplete as it doesn't take the regular server into account), it's used here https://github.com/hyperledger/aries-framework-go/blob/b1decdfed852057fe64660b40ac705953b4d6d0f/pkg/didcomm/transport/ws/upgrade_srv.go#L28-L35

borancar avatar Aug 29 '22 13:08 borancar