matrix-js-sdk
matrix-js-sdk copied to clipboard
Enable eslint rules: @typescript-eslint/no-floating-promises
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.
Codecov Report
Merging #2291 (af91c9a) into develop (5937e6a) will decrease coverage by
0.02%
. The diff coverage is38.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 |
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.
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 I suggest bringing it up in a Web Weekly meeting where it can be voted upon