passportxyz / passport

Passport allows users to prove their identity through a secure, decentralized UI
Other
993 stars 461 forks source link

Implementation of Soft Deletion for Gitcoin Passport Stamps #1403

Open erichfi opened 1 year ago

erichfi commented 1 year ago

User Story:

As a Gitcoin administrator, I want to implement soft deletion for Passport Stamps, So that deleted and expired stamps are kept in the read replica of the Passport Scorer DB.

Acceptance Criteria

GIVEN a Passport Holder deletes a stamp WHEN the deletion process is initiated THEN the stamp should be marked as 'deleted' or 'expired' but not removed from the read replica of the Passport Scorer DB

AND

GIVEN a Passport Holder's stamp has expired WHEN the system checks for stamp validity THEN the expired stamp should be marked as 'expired' but not removed from the read replica of the Passport Scorer DB

Product & Design Links:

Tech Details:

Open Questions:

Notes/Assumptions:

nutrina commented 1 year ago

After a discussion with the engineering team, we came to the conclusion that the soft-delete is not the best solution because:

Alternatively we propose to creates an Events table, that will track all the DB events (for the passport stamps - the CeramicCache table - for now):

This would allow recording all events, so the users pattern of refreshing stamps could also be evaluated over time We think that this approach is technically feasible, we do not expect this to result in an overflow of data events that we cannot handle. And in the future we might offload the events table or switch to another external storage more suitable for such use-cases (event queue, event stream, etc ...)