Page MenuHomePhabricator

'Add links' saves 0 links, makes a dummy edit
Closed, DuplicatePublicBUG REPORT

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Etonkovidova subscribed.

Thank you, @matej_suchanek for filing a bug! I found more examples and re-checked some Add link editing workflows that could result in recording "Added 0 links.".
So far, unfortunately, I could not reproduce the bug. I'm moving the task to Need Discussion/Analysis column on the Growth team workboard.

matej_suchanek renamed this task from Add links save 0 links, makes a dummy edit to 'Add links' saves 0 links, makes a dummy edit.Apr 6 2023, 9:45 AM

While it may partly be caused by upstream issues, I still wonder whether the tool should attempt to save the page when no link was selected for addition.
What is the expected behavior in that case? If it is "no change," is there a guarantee? (We can see there is not.) Wouldn't just "not attempting" be more proof?

We use null edits for convenience when the user rejects some links but doesn't accept any, so that the same code can handle them.

I don't think this issues are specific to edits intended to be null edits; if the user chose to add some links, unrelated markup changes would still be a problem (although maybe a smaller one).

It's a bit tricky to set a guardrail to ensure that an edit is a null edit, due to edge cases like pre-save transforms. I guess a MultiContentSave hook could check the edit summary and if it's the Add Link autosummary (which is fortunately machine-readable) with 0 additions, it could prevent the save..