Page MenuHomePhabricator

alreadyblocked error when reblocking IP range with unnormalized block address via API
Closed, ResolvedPublic

Description

I can't reblock 1.2.3.4/24 via API even if I used the reblock=1 parameter. I got alreadyblocked error.
But 1.2.4.0/24 can be reblocked.

You may want to run this code to reproduce it quickly.

function doBlock(user) {
    var api = new mw.Api();
    api.postWithEditToken({
        'action': 'block',
        'expiry': '1 minute',
        'user': user,
        'reblock': '1'
    }).then(function(data) {
        console.log(data);
    }, function(error) {
        console.error(error);
    });
}
doBlock('1.2.3.4/24'); // ok
doBlock('1.2.3.4/24'); // alreadyblocked error
doBlock('1.2.4.0/24'); // ok
doBlock('1.2.4.0/24'); // ok

Event Timeline

Hamishcn reopened this task as Open.
Hamishcn claimed this task.
Hamishcn removed Hamishcn as the assignee of this task.
Hamishcn updated the task description. (Show Details)
Hamishcn subscribed.
Xiplus renamed this task from alreadyblocked error when reblocking IP range and the CIRD is not normalised via API to alreadyblocked error when reblocking IP range with unnormalized block address via API.Jun 20 2020, 7:07 AM
Xiplus claimed this task.

The bug no longer exists