HomePhabricator
Diffusion Comm b9ee04633890

[Flow] improve report related types

Description

[Flow] improve report related types

Summary:
D7916 introduced id field on the client side to identify reports and avoid comparing the entire blob each time - this is different from keyserver id assigned by the backend database.

It was properly added for ClientThreadInconsistencyReportCreationRequest and ClientEntryInconsistencyReportCreationRequest which are only ClientReportCreationRequest.

By mistake, it was also added for ErrorReportCreationRequest, MediaMissionReportCreationRequest and UserInconsistencyReportCreationRequest types which are used as both ClientReportCreationRequest and ReportCreationRequest.

That caused diverging types, invalid validators (keyserver validators were implemented without the id field) and a lot of confusion pointed out by @ashoat here:

This shouldn't cause any issues for older clients, the id field is extracted in the current code version, and also was in the past (D7910).

The main issue is that validators were not reflected in types, this diff should fix this.

Test Plan:

  1. FLow.
  2. Make sure validators are properly defined (without id field).
  3. report-store-reducer.test.js and report-store-ops.test.js.
  4. Try sending some reports and make sure it succeeded..

Reviewers: ashoat, bartek

Reviewed By: ashoat

Subscribers: tomek, ashoat

Differential Revision: https://phab.comm.dev/D9893

Details

Provenance
kamilAuthored on Nov 15 2023, 4:05 AM
Reviewer
ashoat
Differential Revision
D9893: [Flow] improve report related types
Parents
rCOMM591adc4aed97: [lib] Update `checkIfDefaultMembersAreVoiced` to handle…
Branches
Unknown
Tags
Unknown