Page MenuHomePhabricator

Allow storage of client hints for revisions of deleted pages
Closed, DeclinedPublicBUG REPORT

Description

What is the problem?

If I attempt to save client hints for a revision of a page that has been deleted, it will return:

{'errorKey': 'rest-nonexistent-revision', 'messageTranslations': {'en': 'The specified revision (10377) does not exist'}, 'httpCode': 404, 'httpReason': 'Not Found'}
Steps to reproduce problem
  1. Install the CheckUser (client hints will be enabled by default)
  2. While logged out, edit a page with Firefox
  3. Record the revision ID of the edit you just made
  4. Login as an admin user and delete the page
  5. Run this command, replacing <rev id> with the revision ID you found in step 3
curl 'http://localhost:8080/w/rest.php/checkuser/v0/useragent-clienthints/revision/<rev id>' -H 'Content-Type: application/json' --data-raw '{"architecture":"","bitness":"64","brands":[{"version":"24","brand":"Not)A;Brand"},{"brand":"Chromium","version":"116"}],"fullVersionList":[{"version":"24.0.0.0","brand":"Not)A;Brand"},{"brand":"Chromium","version":"116.0.5845.96"}],"mobile":false,"model":"","platform":"Linux","platformVersion":"5.10.0"}'

Expected behavior: It is successful (the message is something like: We collect user-agent client hint data to support...
Observed behavior: The exception above.

Environment

Wiki(s): CheckUser 2.5 (999417f) 13:47, 28 August 2023.

Event Timeline

Note to self: After deleting the page in step 4, try recreating the page by making an edit to it (not by undeleting it) and see what happens when you try to set client hints.

Do we automatically, and immediately, delete revisions of pages? If so, then we could think about this. If we don't automatically and quickly (within seconds) delete revisions, then I think it's fine to leave this as-is.

(Wrote this as Kosta was writing their message)
From memory, we had discussed this and thought that collecting the data for deleted revisions was probably going to only allow users experimenting with the API to submit data. However, I am open to changing the code to allow storage for deleted revisions.

I was raising bugs based on discussions in T342790. Sorry if those discussion have been superseded.

I was raising bugs based on discussions in T342790. Sorry if those discussion have been superseded.

No problem. I forgot to mention at the time that I had discussed this.

Do we automatically, and immediately, delete revisions of pages? If so, then we could think about this. If we don't automatically and quickly (within seconds) delete revisions, then I think it's fine to leave this as-is.

I can think of no such feature.

The only situation I can see this having an issue for is if an admin deletes a page just after a user successfully makes an edit. However, this should be rare and we can keep an eye on this in Logstash (using this query). So far there have been only 5 times where clients reported having this issue.

Based on the above, I'm going to close this as declined.