matrix-js-sdk icon indicating copy to clipboard operation
matrix-js-sdk copied to clipboard

Enable eslint rules: @typescript-eslint/no-floating-promises

Open hughns opened this issue 2 years ago • 2 comments

This builds on https://github.com/matrix-org/matrix-js-sdk/pull/2290 and is part of https://github.com/matrix-org/matrix-js-sdk/issues/2118

Rather than attempting to correctly fix the ambiguities that have been identified I have added TODO items to the codebase.

My suggestion is to merge this PR and then raise smaller PRs to address some of the suspect areas that might be causing race conditions.


This change is marked as an internal change (Task), so will not be included in the changelog.

hughns avatar Apr 09 '22 17:04 hughns

Codecov Report

Merging #2291 (af91c9a) into develop (5937e6a) will decrease coverage by 0.02%. The diff coverage is 38.28%.

@@             Coverage Diff             @@
##           develop    #2291      +/-   ##
===========================================
- Coverage    59.56%   59.54%   -0.03%     
===========================================
  Files           91       91              
  Lines        16416    16425       +9     
  Branches      3784     3784              
===========================================
+ Hits          9778     9780       +2     
- Misses        6638     6645       +7     
Impacted Files Coverage Δ
src/http-api.ts 54.42% <0.00%> (ø)
src/interactive-auth.ts 67.50% <0.00%> (ø)
src/store/indexeddb.ts 1.11% <0.00%> (ø)
src/webrtc/callEventHandler.ts 7.69% <3.12%> (-0.11%) :arrow_down:
src/models/relations.ts 50.33% <7.69%> (-0.34%) :arrow_down:
src/webrtc/call.ts 36.07% <11.36%> (-0.05%) :arrow_down:
src/crypto/dehydration.ts 11.71% <18.18%> (-0.11%) :arrow_down:
src/client.ts 38.03% <25.00%> (ø)
src/models/room.ts 57.34% <40.00%> (ø)
src/crypto/verification/Base.ts 73.15% <50.00%> (ø)
... and 14 more

codecov-commenter avatar Apr 09 '22 17:04 codecov-commenter

With regards to all the sites where errors are not handled. If it is the accepted design pattern is that a consumer of the API should register a global unhandledrejection handler then this should probably be stated in the documentation.

hughns avatar Apr 11 '22 17:04 hughns

Cleaning up this stale PR. I would still advocate for the application of the @typescript-eslint/no-floating-promises rule on this project as it forces the explicit handling of promises.

hughns avatar Jan 04 '23 17:01 hughns

@hughns I suggest bringing it up in a Web Weekly meeting where it can be voted upon

t3chguy avatar Jan 11 '23 11:01 t3chguy