Fix a performance regression in `/sync` handling, introduced in 1.49.0.