As someone concerned about performance, I want to make sure no UPDATEs are ran when watching a page unless the watched state or the expiry changed. If I watch a page with the expiry 9999-01-23T00:00Z, and then re-watch again with the same expiry, it should not attempt any database transactions since nothing changed.
Background: The logic up until now was to run an UPDATE if either the watched state changed or any expiry value is provided. It did not actually compare the stored expiry with the new one, meaning if I could re-watch a page with the same expiry and it'd unnecessarily run an UPDATE every time.
Acceptance criteria:
- No UPDATE is performed unless it has to.
NOTE: this may be difficult to test manually; you could try observing the SQL log (with $wgDebugDumpSql set), or perhaps add log/var_dump statements to WatchedItemStore::addWatchBatchForUser()