Skip to content

Message Dependencies

Torsten Grote requested to merge 382-message-dependencies-2 into master

This MR adds a new table to the database to hold message dependencies. It introduces two more message states (pending and delivered) and completely changes the validation and message delivery logic.

Since this is a very invasive change, please review carefully. It is better to catch issues now than having to debug things later. If you notice an area without tests, please let me know. I tried to have tests for all changes.

Unfortunately, this MR turned out rather large, but most of it are actually tests and you can review one commit after the other without needing to see the full changelog.

In order to reflect the new states, things that were previously true for VALID messages have been changed to now be true for DELIVERED messages. This might have changed the semantics in some places and can have unindented side-effects.

The DatabaseComponent was extended with methods for:

  • adding dependencies
  • getting dependencies and states of a message
  • getting messages that depend on a message (dependents) and their states
  • getting messages to be delivered (by startup hook)
  • getting pending messages to be possibly delivered (by startup hook)

The valid column in the database was renamed to state along with the associated methods to better reflect its new extended meaning.

Since pending messages should not be available to clients, many database queries have been modified to only return results for delivered messages. I might have missed some. Please check carefully. Also you might want to think about how you could create arbitrarily large transactions by sending malicious messages.

Please note that the database version was bumped in this MR.

Closes #382 (closed)

Merge request reports