githubbob42 / mingle2github2

0 stars 1 forks source link

TECH DEBT: check for "replay" flag when processing events #5810

Open githubbob42 opened 5 years ago

githubbob42 commented 5 years ago

Mingle Card: 6176 Narrative

We are writing the same event to the database(s) twice but can avoid this by checking the replay flag.

Acceptance Criteria

Only handle/store event-queued events when run via replay without losing and data.

Analysis

In the offline/config.js module we have code that we believe is supposed to only run during event replays but it handles EVERY event-queued event.  The new offline bus that DP wrote triggers an event-queued event and then writes the event data to the respective database.  But there is an app.on(‘model:event-queued’, function(evt) {...}) ) handler that handles EVERY event-queued event and writes its data to the database.  In theory, this handler is for only replay events.

Since we are replaying events that already happened, these events should idempotent and it should not matter.  However, this is a technical debt that we should be able to rectify by checking the “replay” flag of the event and bailing out if it not a replay event.

Related Stories

Tasks

{{ table query: SELECT Number, Name, Owner, 'Task Status' WHERE Type = Task and Story = THIS CARD ORDER BY Status }}

Defects

{{ table query: SELECT Number, Name, Owner, 'Status' WHERE Type = Defect and 'Related Story' = THIS CARD }}

Impact Analysis

Developers: Fill in this section during code review.

Test Plan