It is even worse - the encoder is so bad that even slight moves on the plane parallel to the rotation (i.e. "bending" of the axis) activates the contact...
I have decided to use an old ps2 mouse - the encoders are excellent and I think debouncing is done within the hardware. The problem would be with the "hardware" i.e. connecting it mechanically to the bike chain, but then it is a topic for another forum.