SO-Close-Vote-Reviewers / UserScripts

Various user scripts that add features to the review queue or to the chat room
Other
56 stars 41 forks source link

[CVRequestArchiver] Fix some deleted messages not showing up in transcript #193

Closed NobodyNada closed 2 years ago

NobodyNada commented 3 years ago

The code to search for deleted messages in transcripts worked by grabbing 2 pages (1000 events) from the target chat room in reverse order, starting 15000 message IDs past the end of the transcript. This can fail for high-traffic rooms such as CHQ, if the room's chat traffic accounts for more than 1/15 of chat messages on the server.

This PR fixes that issue by continuing to fetch events until we reach the beginning of the visible transcript, instead of stopping after two pages.

makyen commented 2 years ago

I appreciate you working on this. However, I resolved it another way. As you're aware, the code as it was prior to you working on it made assumptions about being able to get all the transcript events without checking that it would get all of them either at the beginning or at the end of the transcript page. I ended up rewriting it such that it now verifies that it fetches all the transcript events both at the beginning and at the end with a limitation on the maximum number of attempts which it will make at getting all of the events.