Artificial intelligent assistant

Strange use of 終わる > > When he was finally forgiven and allowed to come out of his cupboard the summer holidays had already begun. > **** > Dudley had already broken the camera he'd just been bought, crashed the radio controlled plane, and on top of all that, on the day he rode his racing bike for the first time he crashed into Mrs Fig, who was crossing Privet road on crutches, and _the incident in which she got knocked down had ended._ I can't understand how is being used in this sentence. My translation of the final clause makes no sense. I'm not even sure if is the subject or object of the verb.

I think they meant to say...

>
> "By the time~~, had (already) done... / had (already) gone through..."

> ABC
> "By the time he (=Harry) was finally forgiven and allowed to come out of his cupboard... Dudley had already done A, B, and C."

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 787dbff9960317cc7af556f6175c9900