wcf – SharePoint Online Remote Event Receiver intermittently not firing

I figured this one out in the end, but thought I’d post it with an answer in case it helps anyone else.

Scenario: SharePoint Online containing a custom list. Remote Event Receiver implemented via a provider-hosted add-in hosted in Azure.

I noticed that sometimes the receiver didn’t appear to fire. I debugged it using Visual Studio to check. One of the columns in the list was a multi-text column, and I noticed that for the items where the event didn’t trigger, there was more data than usual in the multi-text column. I copied the text from the muti-text box into notepad, and set up a test. I added an item manually and pasted all the text. It didn’t fire (either for synchronous or asynchronous events). I then only copied about half the text and tried again. This time it fired. I went back and forth a bit until there was a one-character difference between firing and not firing. I then tried updating the title by one character, leaving the multi-text, and this also affected the behaviour – so this was an issue to do with the total size of the list item, not solely the size of the multi-text column.

I couldn’t find anything about list items with large amounts of data having issues with Remote Event Receivers, but it was quite hard to research the issue as there are so many questions out there about RERs generally.