Bug fix #2718 appservice txnid should be different for each batch of events (#2719)
Bug fix #2718 appservice txnid should be different for each batch of events (#2719)

See issue: [#2718](https://github.com/matrix-org/dendrite/issues/2718)
for more details.

The fix assumes that if the number of transaction items are different,
then the txnid should be different.

txnid := OriginalServerTS()_len(transactions) 

The case that it doesn't address is if the txnid generated this way is
the same for 2 different batches of events which have the same
OriginalServerTS and the same array length.

Another option:

txnid := OriginalServerTS()_hash(transactions)

Would love to hear other ideas and ways to fix this.

### Pull Request Checklist

* [x ] I have added added tests for PR _or_ I have justified why this PR
doesn't need tests.
* [x ] Pull request includes a [sign
off](https://github.com/matrix-org/dendrite/blob/main/docs/CONTRIBUTING.md#sign-off)

Signed-off-by: `Tak Wai Wong <fe7f4aa43a7165ee839197d7986db1e95d4b9fa2@hntlabs.com>`

Co-authored-by: Tak Wai Wong <fe7f4aa43a7165ee839197d7986db1e95d4b9fa2@hntlabs.com>
matrix-org/dendrite,matrix-org/dendrite,matrix-org/dendrite,matrix-org/dendrite